On_Dirty

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
 
A

Allen Browne

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.
 
C

Cheval

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.
 
R

Rick Brandt

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?
 
D

Dirk Goldgar

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?
 
C

Cheval

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.
 
C

Cheval

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.
 
D

Dirk Goldgar

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.
 

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