Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to bypass error message when closing form 1

Status
Not open for further replies.

BitZero

Programmer
Mar 11, 2008
100
US
I have a form with the Data Entry property = yes, and it's bound to a table with 4 required fields. Say I enter data into one of the fields, and then decide to exit the form. When the DoCmd.Close executes, I get an error message: "The field 'tblxxxxx.fieldxxxx' cannot contain a Null value because the Required property for this field is set to True. Enter a value in this field.' My only choice is to click on OK, and then it stays in the form. How can I programatically ignore this message? I just want to exit the form without writing the record.
Thanks
 
Say I enter data into one of the fields, and then decide to exit the form
Press the Escape key before exit the form ...
 
PHV - thanks for the reply. I didn't know about the Escape key thing. It works! Is there a way to programmatically do something equivalent to hitting the escape key?
 
Me.Undo

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top