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!

Prevent Me.Requery from jumping to 1st record

Status
Not open for further replies.

RiderJon

Programmer
Aug 26, 2002
190
FR
Hi all,

I use Me.Requery to refresh a form's data. But every time I click the refresh button, it jumps to the first record.

I could store the "primary key" before Me.Requery and do a Me.Filter by the "primary key".

But I was wondering if the jumping to first record was by design or something I might have overlooked.

Any other ways to work around it?

Thank you

RiderJon
"I might have created ctrl+alt+del,
But Bill made it famous" - Dr. Dave
 
I believe it is by design.

In a lot of circumstances, using Refresh in stead, is enough.

Requery will display changes from "outside" this form (multiuser), whilst refresh will only refresh the current recordset (not react to new records added by other users)

Press F1 on Requery and Refresh...

When I need to keep the form at the current record, I use what you describe, capture the pk, requery, but then I do a .findfirst.

Roy-Vidar
 
Thx Roy for clarifying

RiderJon
"I might have created ctrl+alt+del,
But Bill made it famous" - Dr. Dave
 
RiderJon,
It's been several years, but I think I accomplished what you're wanting to do by saving off the bookmark and restoring it after the requery.

Tranman
 
Erm - Help files on "Bookmark":
"Requerying a form invalidates any bookmark set on records in a form."

It's my experience that it might often work, but, when new records are added, the sort order is changed, the result might be en error. So be careful;-)

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top