Form's Dirty property...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a Form that has multiple controls on it. I want to detect if any of the
information in any of the controls has changed. So, when the user goes to
close the form I check the Me.Dirty property. If it's True then I want to
save
the data.

The problem is that I can make changes and the form never comes back
with Me.Dirty = True.

Is there something that I am missing?

Thanks.
 
Joe said:
I have a Form that has multiple controls on it. I want to detect if any of the
information in any of the controls has changed. So, when the user goes to
close the form I check the Me.Dirty property. If it's True then I want to
save
the data.

The problem is that I can make changes and the form never comes back
with Me.Dirty = True.

Is there something that I am missing?


Dirty only applies to a record source record. It has no
meaning for unbound forms.

If your form is bound, Dirty works as you want, but there is
no need for a save button because changed/new records are
automatically saved.

If your form is unbound, you will need to use each data
controls AfterUpdate event to set a modult level variable to
simulate the Dirty property.
 
In
Joe said:
I have a Form that has multiple controls on it. I want to detect if
any of the information in any of the controls has changed. So, when
the user goes to close the form I check the Me.Dirty property. If
it's True then I want to save
the data.

The problem is that I can make changes and the form never comes back
with Me.Dirty = True.

Is there something that I am missing?

First question: is it a bound form, and are these bound controls?
Unbound controls don't dirty the form.

Second question: in what event are you checking Me.Dirty? The form's
Close and Unload events are too late; the record has already been saved.
 
Back
Top