RobertIngles
Technical User
The first part of the code works fine. If the user clicks Yes, they are returned to the form with focus on the proper field.
If the user clicks No, they are also returned to the form with focus on the field. I want the form to close without saving if they select No:
Option Compare Database
Option Explicit
Private Sub SaveandCloseButton_Click()
If IsNull([EncryptionStatus]) Then
MsgBox "Encryption Status Cannot be Null. Press OK To Return To Continue With Profile Creation or Cancel to Exit Without Saving", vbYesNo
If vbYes Then
Me.EncryptionStatus.SetFocus
Else
If vbNo Then
DoCmd.Close , "", acSaveNo
End If
End If
End If
End Sub
Thanks for your help!
If the user clicks No, they are also returned to the form with focus on the field. I want the form to close without saving if they select No:
Option Compare Database
Option Explicit
Private Sub SaveandCloseButton_Click()
If IsNull([EncryptionStatus]) Then
MsgBox "Encryption Status Cannot be Null. Press OK To Return To Continue With Profile Creation or Cancel to Exit Without Saving", vbYesNo
If vbYes Then
Me.EncryptionStatus.SetFocus
Else
If vbNo Then
DoCmd.Close , "", acSaveNo
End If
End If
End If
End Sub
Thanks for your help!