Trying to fix problem with saving records on close

hammerva

Registered User.
Local time
Today, 20:45
Joined
Dec 19, 2000
Messages
102
Hello its me again. :rolleyes:

More headaches with Access 97. I have a form with one command button where the intention is to save the record and close the form. I also have a couple edit checks in the BeforeUpdate event. My problem is that even if I hit the errors and set Cancel=True it still closes the form.

Is there a way to stop it from closing the form if the BeforeUpdate was cancelled. I tried add commands to save the record before the DoCmd.Close but getting errors because of the Cancel=True.

Maybe the easy way would be to create a save button and a close button.

Thanks again.
 
Have you tried this :

DoCmd.Close acForm, "Form_name", acSaveYes

Hope this helps

Andy
 

Users who are viewing this thread

Back
Top Bottom