Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to requery after update/insert/delete

Status
Not open for further replies.

snerting

Programmer
Oct 20, 2005
52
Hello

Due to the structure of the database and how our meta-data versioning of the data works, I have to do a requery on each form after update. I'm not allowed to call Me.Reqery in the "AfterUpdate" event, so I didn't see any other way of doing it than put the requery in a timer (if afterupdate had been run, the timer would requery, otherwise it would just return). I don't really like timers to be honest, and now they have started behaving badly, causing errors (ODBC call failed etc) when swapping records.

Is there _any_ way I can perform a Requery (which isnt asynch) after doing an update? What I'd like is typically an event that is called after the complete update transaction.
 
What is keeping you from calling the requery (I assume you get an error)? My most recent Access VBA app calls a sub doing a Me.Requery from the AfterUpdate event of dozens of controls of the form (due to customer's wish to instantly write a new record with every change made). It makes things a little slow but it works fine and error-free.
 
Why are you "Not Allowed", to run requery?
Because it resets the bookmark each time?
If so try
Me.recordset.Requery or
Me.Recalc

...not sure, what your objective is?
 
Well, strangest thing. The error message actually went away. Possibly because I removed most of the timres. Don't know. Can't recall the exact sound in the error message when calling Me.Requery in AfterUpdate, but it suggested that the operation was not permitted.

My new problem now is that the requery doesn't seem to requery at all, meaning I have to switch the main form to the next record and then back again to have the subforms requery (all the subforms now have Me.Requery in AfterUpdate). I'll dig more into it and come back with more questions (or answers).

Thanks for the answers so far and sorry the problem turned out to be invalid.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top