A
Angela
I would like to confirm a record change before the user navigates to another
record. If the employee record has been changed, I want to ask the user if
they want to save the changes before moving to another record using
yes/no/cancel where cancel leaves them on the current record. I believe the
coding belongs in the "oncurrent" event, something like this:
Dim strResp As String
If Me.Dirty Then
strResp = MsgBox("You have made changes to this employee record. Do
want to save these changes before moving to another record?", vbYesNoCancel,
"Save Changes?")
If stresp = vbNo Then
Me.Undo
Resume Next
ElseIf strResp = vbCancel Then
Cancel
Else
Resume Next
End If
End If
The only problem is that there is no Cancel in this event, so how can I
cancel the navigation to another record?
Thanks
record. If the employee record has been changed, I want to ask the user if
they want to save the changes before moving to another record using
yes/no/cancel where cancel leaves them on the current record. I believe the
coding belongs in the "oncurrent" event, something like this:
Dim strResp As String
If Me.Dirty Then
strResp = MsgBox("You have made changes to this employee record. Do
want to save these changes before moving to another record?", vbYesNoCancel,
"Save Changes?")
If stresp = vbNo Then
Me.Undo
Resume Next
ElseIf strResp = vbCancel Then
Cancel
Else
Resume Next
End If
End If
The only problem is that there is no Cancel in this event, so how can I
cancel the navigation to another record?
Thanks