subform AfterUpdate event

K

Kerry

Does anyone know why a subform's AfterUpdate event is fired when moving to a
different record on the form itself even though absolutely no changes have
been made to either the form's record or the subform's record?
 
G

Graham Mandeno

This should not happen. However, remember that a form record can be changed
by code, without the user doing anything. A record can also be made "dirty"
by setting the value of a field to the same value that it already contains.
It will not look like it's been changed, but the AfterUpdate event will
still fire.

Check for some of these things.
 
M

Marshall Barton

Kerry said:
Does anyone know why a subform's AfterUpdate event is fired when moving to a
different record on the form itself even though absolutely no changes have
been made to either the form's record or the subform's record?


The only time I have seen that kind of thing is when there
was some code that changed a field in the subform. Check
both form's Current event.
 
K

Kerry

(Note: this is to both Marshall and Graham.)

Thanks, you two, for replying. Although I'll redouble my efforts to look for
a programmatic update occurring, this was actually the thing I looked for
first (since this was happening, fortunately, while testing, so I knew what
was entered and what was not). I did so by setting a breakpoint early on and
stepping through the code line by line. However, it's always possible that I
misplaced the start of the breakpoint, so I'll go back in that direction.

Again, thanks.

Kerry Kleiber
 
G

Graham Mandeno

Hi Kerry

Try inserting:
If Me.Dirty Then Stop
at various points in event procedures.

This will effectively give you a "conditional breakpoint" to narrow down
your search.
 
Top