Problem with Me.Requery

  • Thread starter Thread starter Jeff via AccessMonster.com
  • Start date Start date
J

Jeff via AccessMonster.com

I'm trying to run me.requery in the on_current event of my main form but it
hanging up (I just get an hour glass). Basically, I'm trying to requering
the data source so that users are looking at the most recent data when they
move to a new record. Is there a better way to do this?
 
You should make the refreshment before moving to the next record. Doing it
from the on_current event might be the worst place to do it.

Also, creating a query that return only one record at a time is probably a
better idea for doing this.
 
Hello Jeff:
You wrote in conference microsoft.public.access.adp.sqlserver on Mon, 09
May 2005 19:06:25 GMT:

JvA> I'm trying to run me.requery in the on_current event of my main form
JvA> but it hanging up (I just get an hour glass).

which creates a loop: requery again fires on_current.

You can modify your code like this to avoid recursion:

sub on_current
static flag as boolean
if flag then exit sub
flag=true
requery
flag=false
end sub


Vadim Rapp
 
Hi Jeff,

I could be way off here, but this looks like it is going to go round in
circles,

e.g.

fire the on_current event
requery
the requery fires the on_current event

Are you having problems with concurrency or do you think you need to
refresh, because in the normal run of things this is not normally a problem
moving from one record to the next. but, I don't like the idea of browsing
records with the navigate at the bottom, personally I use a search screen
that find the record I want then I open a form with just that one record, so
I never see this problem.
 
Thanks for the replies. I think you're right Alex in that it might be
better to remove the navigation bar and rely on a search to force the
requery of data. My problem is that if a user has his/her form open all day
without triggering an action then the data could possibly have been
changed.

Vadim, I'm a bit confused on how I would use a flag to break the loop.
 
Back
Top