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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

After requery return to original record

Status
Not open for further replies.

robinguild

Technical User
Jul 17, 2001
5
0
0
GB
After running a requery how do I return to original record?
 
There's more than one way of skinning a cat .. ..

Are you Requerying as a way of saving the changes to the current record ?

If so then, instead, use
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

If you must requery then you have options.

A) Create a module level variable
Store the record's Primary Key value into the variable
Requery
do a Find Record and match to the variable stored

B) set a BookMark on the Me.RecordSetClone
Requery
return to the bookmark



'ope-that-'elps.


.. .. but it still tastes like chicken


G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.
 
I did something like this:

Before Requery - store the Key field in an unbound control on the parent form (I was requerying a subform)

Perform The Requery

In the OnCurrent event of the subform check the value in the parents text box is not null, if it isnt, then go to the record matching the key field.

Unset the textbox on the parent form

---
Works for me.
 
That's effectivly a variation on my option A above - just using a hidden text box control on the form to do the work of the global variable.
Either way .. ..



G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top