Cancelling events in BeforeUpdate

stepone

Registered User.
Local time
Today, 18:44
Joined
Mar 2, 2004
Messages
97
Hello all,

I have a form where I want to validate enties before moving off the record.

I put my validation in the BeforeUpdate event of the form. If validation fails, then I set Cancel=True. So far, so good.

But if the user closes the form (either with my close button, or the standard close button), or presses 'Page down' to move to the next record, then even if validation fails, the form will close (or move record). What I want is for the user to be left with the form open, on the current record.

Can someoneon point me in the right direction ?

Thanks,
StepOne
 
Enable/Disable The Control Box X Button

The form named "fTestCancelFromUnloadEvent" in the sample db will demonstrate how you can prevent a user from closing a form and also the application unless they do exactly what you want them to do.
 

Users who are viewing this thread

Back
Top Bottom