Well, I just tried something out, just for kicks, and I got this to work.
I created a Combo box and here are some of the properties I set:
Record Source Type = Value List
Row Source = "FName";"First Name";"LName";"Last Name";"EmpID";"Employee ID"
Bound Column = 1
Column Count (Listed under "Format", not "Data" = 2
Then, in the On Change event, I put this code:
Private Sub Combo6_Change()
Me.Controls(Combo6.Column(0)).SetFocus
End Sub
I guess, all you really need to know is this:
To set the focus of a control, that you have the name of (as a string) just put:
Me.Controls(control's name).SetFocus
I just kinda went a step beyond. Also, with the ComboBox version, you eliminate the problem of accidentally typed incorrect control names, and can choose "User Friendly" control names.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.