Set Focus on Subform Control

Learn2010

Registered User.
Local time
Today, 10:11
Joined
Sep 15, 2010
Messages
415
I have a form with a subform on it. The subform has subforms. I need to set the focus on a control on one of the subforms. Here is what I am using.

START OF CODE
Forms!frmMain!frmMainSub.Form.frmContactLog.SetFocus
Forms!frmMain!frmMainSub.Form.frmContactLog.ContactMethod.SetFocus
END OF CODE

I use Code 1 to get to the third level. Code 1 works.

Code 1
Forms!frmMain!frmMainSub.Form.frmContactLog.SetFocus

When I add the second line, Code 2, it doesn’t work. I get the message “Run-time error ‘438’: Object doesn’t support this property or method.”

Code 2
Forms!frmMain!frmMainSub.Form.frmContactLog.ContactMethod.SetFocus

Can you help? Thank you.
 
That worked. Thanks.
 

Users who are viewing this thread

Back
Top Bottom