Syntax for Combo Box

  • Thread starter Thread starter Cathy
  • Start date Start date
C

Cathy

I have a combo box where if the user selects "Complete" I'd like the focus to
move to a completion date text box. What is the syntax that I use to say:
When combo box = "Complete"? It must be different from a text box...

Thank you,
 
Use the After Update event of the combo box:

If Me.MyListBox = "Complete" Then
Me.MyTextBox.SetFocus
End If
 
The syntax for referring to a combo box is exactly the same as the syntax
for referring to a text box.

Assuming you're doing this in the module associated with the form on which
the combo box or text box exists, you can use Me.[NameOfControl] (where
[NameOfControl] is the name of either the combo box or text box)

If you're trying to refer to the combo box or text box from anywhere else
(and the form is open), you can use Forms![NameOfForm]![NameOfControl]

If you're getting something that's different than you expect when you try
using that syntax, check that the BoundColumn of the combo box is pointing
to the correct column: that it's actually returning "Complete", and not the
value of some other column in the selected row of the combo box.
 
Back
Top