mcooer0913
New Member
- Joined
- Feb 16, 2009
- Messages
- 22
I am trying to display a message reminding the user (using a userform) to select an option in a combobox. If the user hasn't selected an option, I would like to display a message saying something like "Please select an option." I have used the following code successfully with text boxes:
Private Sub cmdOK_Click()
If Me.txtFirstName.Value = "" Then
MsgBox "Please enter a First Name.", vbExclamation, "Staff Expenses"
Me.txtFirstName.SetFocus
Exit Sub
End If
But when I try to replace the txtFirstName with the combobox control, it doesn't work. Any suggestions?
Private Sub cmdOK_Click()
If Me.txtFirstName.Value = "" Then
MsgBox "Please enter a First Name.", vbExclamation, "Staff Expenses"
Me.txtFirstName.SetFocus
Exit Sub
End If
But when I try to replace the txtFirstName with the combobox control, it doesn't work. Any suggestions?