Dirty event not occur

  • Thread starter Thread starter Martin
  • Start date Start date
M

Martin

Hi,
I have a bound form in Access XP. I use event Dirty and Undo to activate and
deactivate some commandbuttons (as SAVE).
When I edit an existing record, Dirty event occurs, when data is changed.
But when I the record is new, Dirty event doesnot occurs, allthough the
property Dirty of the form is true.

Why?
Thanks
 
The Dirty event does fire for a new record if the user enters something.

It does not fire in Access 2002 if you dirty the record programmatically.
 
I know this.
In my case, I set the recordsource property of this form dynamically. In
designtime this property = "", DataEntry = true

In Runtime I set:
f.recordsource = "xxx"
DoCmd.GoToRecord , , acNewRec

Now I type any word in a control. But the event is not fired.
 
I am unable to repro that Martin.

Created a form with nothing in its RecordSource property, and DataEntry set
to Yes. In Form_Load, assigned a table name to RecordSource. Added a
debug.print line to the Dirty event, and it fired fine, both in Access 2002
and 2003.
 
I have moved the line f.recordsource = "xxx" to another place, then it
works. I don't know, how. But I will try to repro this scenario and tell
you.
Thanks
 
Okay, so that may be the resolution.

Just for the record, Form_Open would probably be the most desirable place to
assign the RecordSource initially (rather than Form_Load).
 
Back
Top