Command Button for closing form

A

A Hewitt

I want to create a command button which performs the same
procedure as the standard form close button, when you
click the standard form close button whilst in the middle
of entering a record it will display an error message if
some of the mandatory fields are left blank.

If i create a button and put the code "docmd.close" on it
it doesn't warn the user that they have entered a
incomplete record it just closes without saving the
record. What code do I need to add to display this
warning message about mandatroy fields etc.

TIA
Ally.
 
V

Van T. Dinh

The Form_BeforeUpdate Event.

Check Access VB Help on the above Event. IIRC, there are sample codes
available on the above Help topic.
 

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