
Originally Posted by
Gicu
My vote is on the BeforeUpdate as you can use its Cancel argument to prevent the update.
Cheers,
Thanks. So I just realized that my prompt will not stop the hover color glitch for the button from happening either. Just to clarify whats happening. User fills out form and gets to the Subject combo box. User types a value that isn't in that list and without moving the cursor to the next text box, they decide to click a button to go to another form or another record without saving. Access will prompt the user to select a value from the list and now the button's hover color is stuck as if the mouse cursor is still hovering over the button. Is there a way to refresh the button so it goes back to normal while the user corrects the Subject value?
Here is the code I have in the Before Update event:
Code:
Private Sub cmbSubject_BeforeUpdate(Cancel As Integer)
If (Me.cmbSubject = "Abstract" Or Me.cmbSubject = "Bench Warrant") Then
Exit Sub
Else
MsgBox ("Please Select Subject From Drop Down List!"), vbCritical, "Requirement"
Cancel = True
End If
End Sub