Hi
I'm not sure if i am going about this the right way, but basically I want a message box on close to either action another message box with an iff statement or simply to close. This is what I have so far, I haven't toyed with any message box iff statements before so I'm not sure quite how to get the desired outcome. I may have gone about it the wrong way. I was able to get the if statement working without a secondary message box and that's where I've come undone :O. Thanks in advance.
Private Sub Form_Close()
Dim Answer As String
If MsgBox("Did you Select Client Contact Service from Type of Service?", vbQuestion + vbYesNo) = vbYes Then
Select Case Answer
Case vbYes
If MsgBox("Did you Check Sample Checkbox?", vbQuestion + vbYesNo) = vbYes Then
Select Case Answer
Case vbYes
DoCmd.RunCommand acCmdSaveRecord
DoCmd.RunCommand acCmdClose
Case vbNo
MsgBox ("Make sure you check Counselling and Therapy Checkbox!")
(hopefully this leaves the form open and can then be checked before closing.)
End If
Case vbNo
DoCmd.RunCommand acCmdClose
End If
End Select
End If
End Sub
I'm not sure if i am going about this the right way, but basically I want a message box on close to either action another message box with an iff statement or simply to close. This is what I have so far, I haven't toyed with any message box iff statements before so I'm not sure quite how to get the desired outcome. I may have gone about it the wrong way. I was able to get the if statement working without a secondary message box and that's where I've come undone :O. Thanks in advance.
Private Sub Form_Close()
Dim Answer As String
If MsgBox("Did you Select Client Contact Service from Type of Service?", vbQuestion + vbYesNo) = vbYes Then
Select Case Answer
Case vbYes
If MsgBox("Did you Check Sample Checkbox?", vbQuestion + vbYesNo) = vbYes Then
Select Case Answer
Case vbYes
DoCmd.RunCommand acCmdSaveRecord
DoCmd.RunCommand acCmdClose
Case vbNo
MsgBox ("Make sure you check Counselling and Therapy Checkbox!")
(hopefully this leaves the form open and can then be checked before closing.)
End If
Case vbNo
DoCmd.RunCommand acCmdClose
End If
End Select
End If
End Sub