Restrict textbox for dropdown

  • Thread starter Thread starter Anna
  • Start date Start date
A

Anna

There is a textbox and a drop down. Once user enters any value in the
textbox he has to select the option from drop down otherwise the cursor
will not allow to move anywhere else accept the drop down and the
textbox unless it delete the value from the textbox how to i do that
needs help.

Thank You.
 
You will need to use the After Update evento of the text box to prevent the
user from going anywhere on the form other than to the comb:

If Not IsNull(Me.MyTextBox) Then
Me.MyComboBox.SetFocus
End If

Then, the before update event of the Combo Box:

If IsNull(Me.MyComboBox) Then
MsgBox "A Selection is Required"
Cancel = True
End If
 
Back
Top