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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Required Field Error

Status
Not open for further replies.

Noah114

Technical User
Mar 31, 2005
59
0
0
US
I have a form that through control boxes established values for the assigned table. I have set 'required' in the table properties for each field. The problem I am running into is if I start entering data into the form, and then just wish to exit without saving, I get an error mandating the required field. How can I set the form simply to close and not saved what was done?
 
You need to undo the record before exiting. For example:

Code:
If Me.Dirty Then
  If Msgox("Save?",vbYesNo)=vbNo Then
     Me.Undo
  Else
     If IsNull(me.txtRequired) Then
        MsgBox "Please complete"
     End If
  End If
End If


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top