Continuos form saves problem

  • Thread starter Thread starter Ker
  • Start date Start date
K

Ker

I have is with a continous form. I am wanting to use it for a
timesheet. At the end of each employees line, I added a command
button to do the validation before it saves which works great. But if
you simply click off that record to the next blank record, it saves it
without doing my checks. How can I prevent this and force them to use
my command button.

Thanks,
Ker
 
Ker said:
I have is with a continous form. I am wanting to use it for a
timesheet. At the end of each employees line, I added a command
button to do the validation before it saves which works great. But if
you simply click off that record to the next blank record, it saves it
without doing my checks. How can I prevent this and force them to use
my command button.

Move your validation code from the button to the BeforeUpdate event of the form.
This fires just before the record is saved regardless of what triggers the save
to occur. This event also has a Cancel argument that you can set to True when
the validation fails. This prevents the record from being saved so it must
either be corrected or cancelled.
 
Back
Top