Continuos form saves problem

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
 
R

Rick Brandt

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.
 

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

Top