Very likely a syntax error.  You need to place focus using the name you've given your subform container, not the name of the SourceObject - which is probably what you're looking for in the object browser.

Access normally names subform objects something like "Child0" by default.  Unless you've renamed it, there should be an object that starts with "Child" in your object browser.  This is where you want to set focus. 
 
You can control the visibility of the subform via your checkbox by placing code behind the checkbox's AfterUpdate event.  If the form (and checkbox) are bound, you'll want to place the code in the form's Current event, as well. 
 
Something like:
 
Me.Child0.Visible = Me.chkSomeCheckbox
 
...should work. 
 

Tom Oakes
Personal PC Consultants, Inc.
[EMAIL PROTECTED]
503.230.0911 (O)
402.968.6946 (C)
734.264.0911 (F)




From: AccessDevelopers@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of kuznickic
Sent: Wednesday, November 02, 2005 6:29 PM
To: AccessDevelopers@yahoogroups.com
Subject: [AccessDevelopers] SetFocus method problem

Hi all,

     Here is the problem that I am having.  For some reason I cannot
set the focus to a subform on the main form.  The error that I keep
getting is that the program cannot find the subform.  Also I noticed
that the form that I have embedded on the subform is not on the object
list in the object browser.  Can anyone tell me why this is?  Also I
would like to have the subform only appear when a checkbox is
checked.  Can anyone help me?

Thanks

Chris






Please zip all files prior to uploading to Files section.




SPONSORED LINKS
Microsoft access developer Microsoft access help Microsoft access database
Microsoft access training Microsoft access programming Microsoft access tutorial


YAHOO! GROUPS LINKS




Reply via email to