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

Select a particular record on change/refresh

Status
Not open for further replies.

Hfnet

IS-IT--Management
Joined
Dec 31, 2003
Messages
369
Location
GB
I have a form which has continuos forms view. When a person changes a record, I refresh the form to update the data, but this puts the focus back to the first record. What I want to be able to do is "follow" the record, so that the record is selected again after the refresh. I would like to do this using Me.id=..... as the reference.
 
You can try

Code:
Me.RecordsetClone.FindFirst "[Id] = " & Me![id] & ""
Me.Refresh
Me.Bookmark = Me.RecordsetClone.Bookmark

See if that does it.

Paul
 
On testing, I don't think the RecordsetClone method will work but I tested this and it seems to handle the situation.

Code:
Dim myVal 
myVal = Me.id
Me.Refresh
DoCmd.GoToRecord acDataForm, "FormNameHere", acGoTo, myVal

Paul
 
Thanks, in fact I had to use a combination and requery to get mine to work:

Dim myVal
Me.Recordset.FindFirst "id = " & Me!id & ""
myVal = Me.Recordset.Bookmark
Me.Requery
DoCmd.GoToRecord acDataForm, "Main", acGoTo, myVal

This works for me perfectly! Thanks again
 
Interesting combination. Glad you worked it out.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top