Greetings:
I'm using the BeforeUpdate event of a form to check the dirty property in order to prompt the user to ask if they want to save changes. This works fine except that the user gets prompted when the "Save Record" button on the application command bar is clicked. Obviously not necessary...
How can I "filter" out the click event of a button on a custom command bar?
Here's the code I'm using in the BeforeUpdate:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim iAnswer As Integer
Dim ctl As Control
If Me.Dirty Then
iAnswer = MsgBox("save changes?", vbYesNo)
If iAnswer = vbNo Then
Me.Undo
Cancel = True
End If
End If
End Sub
Thanks for any help!!
I'm using the BeforeUpdate event of a form to check the dirty property in order to prompt the user to ask if they want to save changes. This works fine except that the user gets prompted when the "Save Record" button on the application command bar is clicked. Obviously not necessary...
How can I "filter" out the click event of a button on a custom command bar?
Here's the code I'm using in the BeforeUpdate:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim iAnswer As Integer
Dim ctl As Control
If Me.Dirty Then
iAnswer = MsgBox("save changes?", vbYesNo)
If iAnswer = vbNo Then
Me.Undo
Cancel = True
End If
End If
End Sub
Thanks for any help!!