X xolo Registered User. Local time Today, 23:49 Joined May 6, 2009 Messages 34 Dec 22, 2009 #1 How do I use SetFocus to a control with variable name from another form?
Khalid_Afridi Registered User. Local time Today, 19:49 Joined Jan 25, 2009 Messages 491 Dec 22, 2009 #2 you have to use the goto control method on that form and then use the setfocus method. if its subform; then you have to use the full path of the form. for example: DoCmd.GoToControl "yourForm" Forms!formname!subformname!controlname.Setfocus
you have to use the goto control method on that form and then use the setfocus method. if its subform; then you have to use the full path of the form. for example: DoCmd.GoToControl "yourForm" Forms!formname!subformname!controlname.Setfocus
boblarson Smeghead Local time Today, 09:49 Joined Jan 12, 2001 Messages 32,059 Dec 22, 2009 #3 Or if using a variable for the form name and control name you can use: Code: Forms(formVariableHere).Controls(ControlVariableHere).SetFocus
Or if using a variable for the form name and control name you can use: Code: Forms(formVariableHere).Controls(ControlVariableHere).SetFocus
X xolo Registered User. Local time Today, 23:49 Joined May 6, 2009 Messages 34 Dec 22, 2009 #4 Thanks! My problem was to find the right syntax to call the VARIABLE name. Now that should help me, I will give a try!
Thanks! My problem was to find the right syntax to call the VARIABLE name. Now that should help me, I will give a try!