Dirty or Not

Derek Brown
Derek Brown used Ask the Experts™
on
If I Update data in a field on form "A" from a popup form "B" is form "A" Dirty?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
John TsioumprisSoftware & Systems Engineer

Commented:
You can test it...just add this line in the Update method...just before End Sub/End Function
If Form_Name_Of_FormA.Dirty =True then Msgbox "IS Dirty"

Open in new window

Dale FyeOwner, Dev-Soln LLC
Most Valuable Expert 2014
Top Expert 2010

Commented:
You can find out for yourself using the immediate window:

?Forms("FormA").Dirty
Dale FyeOwner, Dev-Soln LLC
Most Valuable Expert 2014
Top Expert 2010

Commented:
Not sure whether the Dirty event (Form_Dirty) will fire though, so you might want to add some code to the Form_Dirty event in FormA to see whether that event actually fires.

Private Sub Form_Dirty

    msgbox "Form A is dirty"

End sub

Open in new window

IF the form is bound, then changing a bound control through code, the form will become dirty. The dirty event will not fire when the form is made dirty through code.

If you change it from private to public, you can however call the dirty event from the other form, if you like.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial