Determine if form values have changed

X

XP

Using Office 2003 and Windows XP.

I need a way to determine if any fields on a form have changed. i.e. has the
user changed any settings or typed or changed text in a text box.

I tried setting a global variable to TRUE in the On_Dirty event, then check
the value of the variable when the user clicks a "Save" button; but this does
not seem to work...changes are not detected even though I change a combo
and/or type in the text box.

Any ideas?
 
X

XP

Hi Allen,

I put: If Me.Dirty then...

in my Save button On_Click event, but I get error:

You entered an expression that has an invalid reference to property Dirty...

I also tried: Me.Parent.Dirty; Me.Form.Dirty...

What am I doing wrong?
 
M

Marshall Barton

XP said:
Using Office 2003 and Windows XP.

I need a way to determine if any fields on a form have changed. i.e. has the
user changed any settings or typed or changed text in a text box.

I tried setting a global variable to TRUE in the On_Dirty event, then check
the value of the variable when the user clicks a "Save" button; but this does
not seem to work...changes are not detected even though I change a combo
and/or type in the text box.


If the form is unbound, then you need to use each control's
AfterUpdate event to set your flag.
 
A

Allen Browne

Is this form bound to a table or query?
If so, it has a Dirty property, and that's all you need.
If not, you will need to use the AfterUpdate event of each control to flag
your own variable as you suggested.
 

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