check to see if subform is dirty

G

Guest

I like to add a dirty control to my close commands similar to this for
particular records:

....
with me
iIf .Dirty = True Then
x = MsgBox("Would you like to save before exiting?", vbYesNoCancel)
Else: DoCmd.Close acForm, stDocName
End If
End With
If x = vbYes Then
call modCmdButtons_cmdSaveClose
ElseIf x = vbNo Then
call modCmdButtons_cmdUndoClose
End If

Basically, the modCmdButtons will either close the form normally - saving
the record, or it will Undo the record and then Close - not saving.

PROBLEM:
I have a form with two unrelated subforms on it - no relations whatsoever to
anything - on purpose.
I want to be able to do something similar to the above if EITHER of the
subforms have had any changes made (The mainform is simply a holder for the
two forms).

Is this possible?
 
R

Rick Brandt

kremesch said:
I like to add a dirty control to my close commands similar to this for
particular records:
PROBLEM:
I have a form with two unrelated subforms on it - no relations whatsoever to
anything - on purpose.
I want to be able to do something similar to the above if EITHER of the
subforms have had any changes made (The mainform is simply a holder for the
two forms).

Is this possible?

By the time your main form close command is running the two subforms will
already have had their changes saved so Dirty for both of them will always be
false.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top