Command Button for closing form

  • Thread starter Thread starter A Hewitt
  • Start date Start date
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.
 
The Form_BeforeUpdate Event.

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