I'm working on a database that sends calendar appointments and notes to Groupwise. I'm trying to use the OnDirty event to set a flag which would pop a MsgBox to remind the user to send the event to the calendar if the data has changed. Everything works great except on one particular form - it's a fairly complex bound form, similar in construct to all the others, but for some reason, I cannot get the OnDirty event to fire. The flag is just a Yes/No field in the table. Here's the code:
The idea is if the data has changed and the user tries to close the form without first sending the appointment, he/she gets a little reminder:
Any ideas? Thanks!
Ken S.
Code:
Private Sub Form_Dirty(Cancel As Integer)
Me!GWdirty = True
'for debugging, to see when the event fires
MsgBox "Form is now dirty."
End Sub
Code:
If Me!GWdirty Then
varMBox = MsgBox("Send this event to the Groupwise calendar?", vbYesNoCancel, "Send to GW?")
Select Case varMBox
Case vbYes
Me!GWdirty = False
Call SendAppointment(Me)
Case vbNo
'do nothing, continue processing
Case vbCancel
'return to the form
Exit Sub
End Select
End If
Ken S.