CraigDouglas
Registered User.
- Local time
- Today, 14:59
- Joined
- Sep 14, 2016
- Messages
- 31
My name is Craig. Please, could someone help me?
I have a form and in the form an email text field. I want a message to pop up when the person tries to close the form and for there to be a Yes No option. If they choose Yes then I want the form to close if they choose No I want the form to remain, so they can add the missing email. The message would be something like "Do you want to leave without putting an email address in?
The code I have been working on and the code that fails to work is as follows.
'------------------------------------------------------------
' Form_AfterUpdate
'
'------------------------------------------------------------
Private Sub Form_AfterUpdate()
On Error GoTo Form_AfterUpdate_Err
If (IsNull(txtCustomerEmailAddress)) Then
Beep
MsgBox "Do you want to leave without " & vbCrLf & _
"putting an email address in?", vbYesNo + vbExclamation, "Email Missing"
If vbNo Then cancle = True
End If
I have tried all day to solve my problem so any help would be appreciated.
Form_AfterUpdate_Exit:
Exit Sub
Form_AfterUpdate_Err:
MsgBox Error$
Resume Form_AfterUpdate_Exit
End Sub
I have a form and in the form an email text field. I want a message to pop up when the person tries to close the form and for there to be a Yes No option. If they choose Yes then I want the form to close if they choose No I want the form to remain, so they can add the missing email. The message would be something like "Do you want to leave without putting an email address in?
The code I have been working on and the code that fails to work is as follows.
'------------------------------------------------------------
' Form_AfterUpdate
'
'------------------------------------------------------------
Private Sub Form_AfterUpdate()
On Error GoTo Form_AfterUpdate_Err
If (IsNull(txtCustomerEmailAddress)) Then
Beep
MsgBox "Do you want to leave without " & vbCrLf & _
"putting an email address in?", vbYesNo + vbExclamation, "Email Missing"
If vbNo Then cancle = True
End If
I have tried all day to solve my problem so any help would be appreciated.
Form_AfterUpdate_Exit:
Exit Sub
Form_AfterUpdate_Err:
MsgBox Error$
Resume Form_AfterUpdate_Exit
End Sub