S
sheniece via AccessMonster.com
I have a modal window, I have 2 buttons a cancel button which disregards and
input and closes the window without saveing. The second button is a close
button which saves the information entered and then closes. I have some
input verification done n a field on the form, if this field is null i
popup a dialog box telling the user to select a value, so the value cannot be
blank or null, My problem is I canceled the close in the unload event if the
value does'nt meet the requirements but the cancel button is also canceling
the close. How do I ignore the check if cancel is pressed.
Private Sub cmdCancel_Click()
On Error Resume Next
Me.Undo
DoCmd.Close
End Sub
Private Sub Form_Unload(Cancel As Integer)
If Len(Me.cboContactDurationID & vbNullString) = 0 Then
MsgBox "Please select the contact duration.", vbOKOnly, "Incorrect
Entry."
Cancel = True
End If
End Sub
input and closes the window without saveing. The second button is a close
button which saves the information entered and then closes. I have some
input verification done n a field on the form, if this field is null i
popup a dialog box telling the user to select a value, so the value cannot be
blank or null, My problem is I canceled the close in the unload event if the
value does'nt meet the requirements but the cancel button is also canceling
the close. How do I ignore the check if cancel is pressed.
Private Sub cmdCancel_Click()
On Error Resume Next
Me.Undo
DoCmd.Close
End Sub
Private Sub Form_Unload(Cancel As Integer)
If Len(Me.cboContactDurationID & vbNullString) = 0 Then
MsgBox "Please select the contact duration.", vbOKOnly, "Incorrect
Entry."
Cancel = True
End If
End Sub