Blank Record saved when click on previous button

dooda

New member
Local time
Today, 20:29
Joined
Dec 13, 2004
Messages
8
Something stupid goes wrong here!

I have a form with my own navigation buttons. The problem is a AddNew button is clicked for a new record, but it automatically adds into the relevant table when I click on the MovePrevious and MoveFirst button without data entry.

Has anyone encountered such problem? Kindly help me.

Many Thanks
-----------------
Dooda
 
You need to put your validation code in the forms BeforeUpdate event to ensure the current record is not saved if your custom validation routine is not passed. Your validation code should check for Nulls and empty string for the fields that you do not want blank for a saved record.

I suggest that you check our my A better mouse trap? sample to see how I control what a user can do if the current record is dirty.
 
Thanks you all, problem solved. I've found the code which dirty the form. Besides, the A-Better-Mouse-Trap is great.
 

Users who are viewing this thread

Back
Top Bottom