Variable Control Name

xolo

Registered User.
Local time
Today, 23:43
Joined
May 6, 2009
Messages
34
How do I use SetFocus to a control with variable name from another form?
 
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
 
Or if using a variable for the form name and control name you can use:

Code:
Forms(formVariableHere).Controls(ControlVariableHere).SetFocus
 
Thanks! My problem was to find the right syntax to call the VARIABLE name. Now that should help me, I will give a try!
 

Users who are viewing this thread

Back
Top Bottom