On_Dirty

  • Thread starter Thread starter Cheval
  • Start date Start date
C

Cheval

I have come across a problem with the On_Dirty Event. It
does not fire if the user add/edits data in a combo box or
list box before a text box.

I can reproduce it time and time again.

Is there help or a patch that I need to apply?

FYI:
OS: Win2K & WinXP
Office: Both Stand alone Office 2003 and multi-version
installs 97, 2K, XP & 2003
 
Just tested in A2003 on WinXP. Form_Dirty fires here, even if the a combo is
the first control that triggers the editing of a new record.

The Dirty event may not fire if the record is dirtied programmatically, and
will not fire if the combo is unbound.

If that is not the issue, do you have JET 4 SP8?
Locate msjet40.dll (typically in windows\system32).
Right-click and choose Properties.
The Version tab will show 4.0.8xxx if you have SP8.
 
What I failed to mention was that the application was
upsized from Access 97. Should that make a difference? I
even created a new Access 2003 file and imported all the
objects and it still does it. And no there is no
programically filled fields, all user input and selected.
 
I wonder if this is similar to what I have seen in Access 97. If a record
is dirtied programmatically you get no BeforeInsert event. Even if you
later enter more data with the keyboard. Seems like a bug to me.

Isn't OnDirty just like BeforeInsert except it works on existing records?
 
Cheval said:
What I failed to mention was that the application was
upsized from Access 97. Should that make a difference? I
even created a new Access 2003 file and imported all the
objects and it still does it. And no there is no
programically filled fields, all user input and selected.

Did you verify that the combo box is bound; that is, has its
ControlSource property set to a field in the form's (updatable)
RecordSource? You're saying that the combo box is bound, the form is
not already dirty, the user types or selects a valid value from the
combo box's list, and yet the form's Dirty event doesn't fire?
 
Arhhh Yes, as I am using the BeforeInsert event to filling
the Order Number field. I completely forgot about that
when I was asked if I programically fill fields. Are there
any work arounds or patches?

OnDirty like BeforeInsert? Yes.
 
Yes. The Combobox is bound. That's correct. Well let me
run you through the process again.

The form opens and moves to a new record and the focus
moves to the add button. The user can either press the add
button or click the combobox field. The user then selects
an entry from the combo box. The BeforeInsert event fires
and in fill in the order number field, the user continues
entering or selecting data yet the on dirty event never
fires.

I have a feeling that the BeforeInsert event is killing
the OnDirty event... Will do more testing today.
 
Cheval said:
Yes. The Combobox is bound. That's correct. Well let me
run you through the process again.

The form opens and moves to a new record and the focus
moves to the add button. The user can either press the add
button or click the combobox field. The user then selects
an entry from the combo box. The BeforeInsert event fires
and in fill in the order number field, the user continues
entering or selecting data yet the on dirty event never
fires.

I have a feeling that the BeforeInsert event is killing
the OnDirty event... Will do more testing today.

It looks like Rick Brandt and Allen Browne between them have identified
the problem and suggested a workable solution, so I'll butt out of this
thread.
 
That's fine. Their answer works fine.
-----Original Message-----


It looks like Rick Brandt and Allen Browne between them have identified
the problem and suggested a workable solution, so I'll butt out of this
thread.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


.
 
That fixed it. I think it still should fire yet maybe
it'll be fixed in the next Service Pack. Thanks.
 
Back
Top