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

do not want to add record

Status
Not open for further replies.

HOMMER

Technical User
Apr 12, 2001
112
US
If the user types in a box lets say date then exits the form I do not want to record this. I have code to check that all the information on the form is filled out before adding the record, but how do I not record the information if they exit the form with out filling out all the fields?.
 

#1

Form_Close
On Error Resume Next
If FormIsNotComplete Then
Cancel = True
End If
End Sub

#2
Form_Close
On Error Resume Next
If FormIsNotComplete Then
If MsgBox("You have not completed the form. Do you still want to exit? Changes will be lost.", vbCritical, "Any Title") = vbYes Then
Me.Undo
Else
Cancel = True
End If
End Sub

Steve King Growth follows a healthy professional curiosity
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top