Hi,
I'm hving a rough time with this button. I would like to give the user of this database access to save or delete the record he/she is working on when they exit the form. This is what I've done:
Private Sub Form_Close()
Dim strMsg1 As String
Dim strMsg2 As String
Dim strMsg3 As String
strMsg1 = strMsg1 & "Data has changed. "
strMsg2 = strMsg1 & "Do you wish to save changes? "
If MsgBox(strMsg2, vbQuestion + vbYesNo, "Save Record?") = vbYes Then
'do nothing
Else
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
End If
End Sub
I understand that: DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
is supposed to delete the record but in my case it still gets saved. Any ideas why this might be?
Thank you.
I'm hving a rough time with this button. I would like to give the user of this database access to save or delete the record he/she is working on when they exit the form. This is what I've done:
Private Sub Form_Close()
Dim strMsg1 As String
Dim strMsg2 As String
Dim strMsg3 As String
strMsg1 = strMsg1 & "Data has changed. "
strMsg2 = strMsg1 & "Do you wish to save changes? "
If MsgBox(strMsg2, vbQuestion + vbYesNo, "Save Record?") = vbYes Then
'do nothing
Else
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
End If
End Sub
I understand that: DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
is supposed to delete the record but in my case it still gets saved. Any ideas why this might be?
Thank you.