Before ON Current Event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to run an action query as the user leaves a record on a form and moves
to the next record. (The form is not closed). The query must run before the
next record is displayed. This is because the query gets parameters from the
current record. The On Current Event fires when the next record is displayed.
This is too late and the query runs with parameters from the new record.

Is there and event which fires as the user leaves a record but before the
next record is dipslayed?

Thanks.
 
The AfterUpdate and BeforeUpdate events runs as you leave the record and
before you move to the next one.
Note: It will run this events only if you updated this record
 
Thak you.

This does the trick. I had tried the After Update, but it was not running
the qury since the changes were on a subform. I have now placed the event in
the AfterUpdate of the subform and get the desired effect.
 
I need to run an action query as the user leaves a record on a form and moves
to the next record. (The form is not closed). The query must run before the
next record is displayed. This is because the query gets parameters from the
current record. The On Current Event fires when the next record is displayed.
This is too late and the query runs with parameters from the new record.

Is there and event which fires as the user leaves a record but before the
next record is dipslayed?

Thanks.

I'm not sure, but I think only if the record was changed; you can then use the
AfterUpdate event. If you're just browsing through records, I'm not aware of
any event that fires after just looking at the record.

John W. Vinson [MVP]
 
You are right on this one, the record must be changed for the event to fire -
I have tried.
 
If you need your code to run every time the record changes, even without
updates, you could remove the standard navigation bar and use your own
navigation buttons. You'd also have to trap keystrokes like Page-Up and
Page-Down, but I think it's possible to do that too.
Paul Shapiro
 
Thanks Paul.
This was considered as an option, however we use filters on this form and
need to see the number of records in the Navigation Bar.

We could use more code to display the number of records, and manage the
change of record by TAB from the last field, but then where does it end?

We only need the procedures to run after an update, so for this time, the
problem is solved.
 
Tom said:
Thanks Paul.
This was considered as an option, however we use filters on this form
and need to see the number of records in the Navigation Bar.

We could use more code to display the number of records, and manage
the change of record by TAB from the last field, but then where does
it end?

We only need the procedures to run after an update, so for this time,
the problem is solved.

An "about to leave this record" event actually made it into the beta of one of
the Access versions a while back, but was yanked from the final release. There
are certainly times when it would be useful.

I have faked it with my own navigation on a few occassions, but as stated it is
a pain to cover all of the different mechanisms that the user has for changing
to a different record.
 
Back
Top