I have a form, "FRM", on which there's a subform "SFRM". When the users unloads FRM, I want to give them the choice of keeping all the changes, losing them by deleting the records from the underlying table, or keeping the FRM open.
But I don't want to bug them with this choice if nothing's been changed. In other words, they should only get the message box if SFRM is "Dirty".
In FRM I tried this:
Private Sub Form_Unload(Cancel As Integer)
If Me.SFRM.Dirty Then
'Here is Msgbox asking the user for a Yes, No, or Cancel.
'That's followed by a Select Case block
End If
End Sub
I then learned that there's no such thing as Me.SFRM.Dirty
. That is, "Dirty" isn't a valid property when you refer to the subform this way.
Even if I 'could' read the Dirty status from within FRM, I read that it wouldn't matter, because once the focus has returned to FRM, the Dirty property is reset to False.
What's the easiest way to track whether the subform has been modified?