How do I set up an event prompt in MS Access?

  • Thread starter Thread starter Guest
  • Start date Start date
You can either use the "Enter" event or the "BeforeUpdate" event.

Using "Enter" can be a little problematic, as sometimes Access automatically
enters a field (for example, if it is the first on a subform) and triggers
this event when all you are doing is loading the form.

"BeforeUpdate" gives you the opportunity to Cancel before it actually posts
the value. It occers just as you try to post the changes.

Sub YourField_BeforeUpdate(Cancel as Boolean)
If MsgBox("Did you check so-and-so?", vbYesNo) = vbNo then
Cancel = True
Me.YourField.Undo
End If
End Sub

- Phil Freihofner
 
Back
Top