GoToControl Help

T

Telobamipada

I have a busy form with certain fields which disable based on the response in
others. I would like to have the curser automatically go to a specific field
based on the response provided in another field and I'm not sure how to code
it on the AfterUpdate Event. Say for this purpose I have fields 1 through 50
on my form and Field 1 is a combo box with "Option1, Option2 and Option3". If
option 1 is selected I want the curser to automatically go to field 10. If
option2 is selected I want the curser to automatically go to field 20 and
Option3 to field 30.
Any help is appreciated!! Thanks!
 
K

Klatuu

In the After Update event of the combo:

dim strCtlName As String

Select Case Me.MyCombo
Case "Option1"
strCtlName = "Field10"
Case "Option2"
strCtlName = "Field10"
Case "Option3"
strCtlName = "Field10"
End Select

Me.Controls(strCtlName).SetFocus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top