Simple Code question, but cannot figure it out.

SD23

Registered User.
Local time
Today, 00:15
Joined
Jun 13, 2006
Messages
60
I have a form. On the form is a pull down menu. When I select a certain value called "Ready" in the pull down menu, I would like to make the cursor go to another text box on the form named dpre. This will make the user fill out that section of the form which is required to fill out if 'ready' is selected.

I am very new at VB. I tried the code underneath but it does not work. I hope someone can help me with the code. I would really appreciate it. Thank you.


Private Sub Status_Click()
If Me.Status.Value = "DP Ready" Then
Forms!Invention_Disclosure_Input_Form!dpre.SetFocus
End If
End Sub
 
What you need to do is have this in the afteropdate event of the select box. This way when the select box is changed then the user will be directed to the relevant area. Lookin at your code you look like you need something like

Code:
Private Sub Status_AfterUpdate()

If Me.Status = "DP Ready" Then
Me.Invention_Disclosure_Input_Form!dpre.SetFocus
End If
End Sub

This is presumin that the select box is called Status and the text box you wish to set the focus to is Invention_Disclosure_Input_Form!dpre.SetFocus and that both objects are in the existing form you are currently working in.

Hope this helps
 
Thanks alot. It did help.
 

Users who are viewing this thread

Back
Top Bottom