Cancelling data entry on the Before Update Event

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

I am working in an Access 97 SR-2 database.

I have a field on a form that I want to review what the
user is entering in it before I allow them to continue. On
the Before Update event of the control I have some code
that I use to evaluate if it is a valid entry. (It is too
complex to do with a validation rule). If I determine that
I want to cancel the entry how do I do it in VBA code? I
do not want it to cancel the whole record. Just the
changes to that field. And I do not want it to fire the
After Update Event because I am cancelling the entry.

Thanks if you have an answer!

Mark
Canada
 
Use an If statement to evaluate your requirement
If it's true, then include "Cancel = True" within the If coding

This can also be used in the _Exit event

HTH - Bob
 
Back
Top