How give user an opportunity to exit a form
Posted on 2013-10-25
I have a form with one required field (in the table setup). And I have the following code in the onclose event of the form. But I want to give the user the opportunity to exit the form with no data entry if they want to do so. Here is my code so far:
Private Sub Form_Close()
If Nz(Me.txtCompanyName, "") = "" Then
MsgBox "You must enter a company name!!!"
How can I present them with a message box that will either let them stay in the form but return the focus to the txtCompanyName field, OR, let them leave the form with no data entry?