Stop form being closed before save button is clicked

G

Guest

I have a form on which users log orders. I have a 'submit' button which
generates an auto email and then closes the form. I also included a save
button on the form which prompts users to enter a value in fields which are
set to 'Is Not Null' in the validation rule. What I need to do is to stop
users from submitting the order (i.e. confirming the order via mail and then
closing the form) until all required fields have been entered. If I could do
all this on 1 button then great, if not then the user could click the Save
button, then submit (at this point if the save button has not been selected
then the user cant submit the order).

Any ideas??
 
A

Allen Browne

Move the code that tests if the fields are null into the BeforeUdpate event
of the form.

There are too many ways a record can be saved to trap it any other way. Be
sure to use Form_BeforeUpdate, not the BeforeUpdate event of a control.

If you want a Save button, all it needs is:
RunCommand acCmdSaveRecord

That will cause Form_BeforeUpdate to run and check the code.
 

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