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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to set up a prompt when I input data to remind me to check
something?
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top