I been trying this code on a button to quit the database. When the user clicks the button to quit, it will check for a required combo box I have. In this combo box is a list of values that I want the user to select from. However, even if the user selects from the value list it will still prompt them to select subject from drop down list. What am I missing here? Here is the code:
If Me.cmbSubject <> Me.cmbSubject.LimitToList Then
MsgBox "Please Select Subject From Drop Down List", vbInformation, "Requirements"
Me.cmbSubject.SetFocus
Exit Sub
End If
I also tried this but couldn't get it to work either. This one will give a run-time error 13 type mismatch error and it points to the first line of code:
If Me.cmbSubject <> "Item 1" OR "Item 2" Then
Here is the entire code:
If Me.cmbSubject <> "Item 1" OR "Item 2" Then
MsgBox "Please Select Subject From Drop Down List", vbInformation, "Requirements"
Me.cmbSubject.SetFocus
Exit Sub
End If