G
Guest
I have an EditRecord form that detects if changes have been made to the
record on the form. I have two buttons; cmdsave and cmdclose. When I click
cmdsave everything is saved perfectly. When I click cmdclose I am prompted,
if changes have been made, to save the changes. Code on cmdClose is:
DoCmd.Close acForm, "Frm_EditBooking", acSaveNo
On the form unload event I have:
If fDataChanged Then
Select Case MsgBox("Do you want to save changes?", vbYesNoCancel)
Case vbYes '*****Problem occurs when this criteria is true****
cmdSave_Click
Exit Sub
Case vbNo
'do nothing
Case vbCancel
Cancel = True
Exit Sub
End Select
End If
cmdSave_click gets to the line:
DoCmd.Close acForm, "Frm_EditBooking", acSaveYes
Then detects an error displaying "The close action was cancelled" Is this
because the form is attempting to close twice? I can't work it out! Can
someone please help!!
Thanks
record on the form. I have two buttons; cmdsave and cmdclose. When I click
cmdsave everything is saved perfectly. When I click cmdclose I am prompted,
if changes have been made, to save the changes. Code on cmdClose is:
DoCmd.Close acForm, "Frm_EditBooking", acSaveNo
On the form unload event I have:
If fDataChanged Then
Select Case MsgBox("Do you want to save changes?", vbYesNoCancel)
Case vbYes '*****Problem occurs when this criteria is true****
cmdSave_Click
Exit Sub
Case vbNo
'do nothing
Case vbCancel
Cancel = True
Exit Sub
End Select
End If
cmdSave_click gets to the line:
DoCmd.Close acForm, "Frm_EditBooking", acSaveYes
Then detects an error displaying "The close action was cancelled" Is this
because the form is attempting to close twice? I can't work it out! Can
someone please help!!
Thanks