Event triggered on next record

What events are triggered when going to another record under the same form?  I need to capture some fields when a record is opened.  The first record is easy.  I can get that in the form open event.  I think I can get the next one with the after update if a field has been changed.  I need to have a way a capturing the data if no fields are changed.  Actually that method would work for after update too.  So is there an event for going from one record to the next?

Thanks,
Ric
JoppaAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Rey Obrero (Capricorn1)Connect With a Mentor Commented:
the On Current event is triggered when you move from record to record without changing anything
0
 
Jim Dettman (Microsoft MVP/ EE MVE)President Online Computer Svcs, WNY IncCommented:
BeforeUpdate, AfterUpdate, and AfterInsert if your leaving a record that is dirty (changed), and OnCurrent when a record gets the focus.

You'll probably want to use OnCurrent.

Just be aware that OnCurrent may fire multiple times for the same record.

Jim.
0
 
Rey Obrero (Capricorn1)Commented:
@jim
<Just be aware that OnCurrent may fire multiple times for the same record.>

i don't think so..

On Current fires only when the focus moves from one record to another.
0
 
JoppaAuthor Commented:
Works great....thanks
0
 
Jim Dettman (Microsoft MVP/ EE MVE)President Online Computer Svcs, WNY IncCommented:
<<@jim
<Just be aware that OnCurrent may fire multiple times for the same record.>

i don't think so..

On Current fires only when the focus moves from one record to another. >>

 That's not the case.  It also will fire if a form is refreshed or required.  When that happens, the focus doesn't move, but the OnCurrent will fire.  Try applying a filter/sort, note the record your on, then remove it and see what happens<g>.  Or just to a Me.Refresh.  OnCurrent will fire.

 As a result, depending on what your doing, you may need to protect your code from getting into an infinite loop by setting a flag.

Jim.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.