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!

Change RecordSetType - Form refreshes

Status
Not open for further replies.

Fonzie

MIS
Feb 16, 2001
74
0
0
CA
On my form I have an edit button that changes the recordsettype of the form. When I do this it requeries the form and goes to the first record. How can I make it stay on/go to the record I was on when I hit the edit button?
 
A starting point:
Dim myBookmark
myBookmark = Me.Bookmark
Me.RecordsetType = 0
Me.Bookmark = myBookmark

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
This sounds like what I'm looking for, but I get the error:

Run-time error '3159'
Not a valid bookmark

Any ideas?
 
So, changing the RecordsetType seems to instantiate a brand new recordset ...
1) save the value of the actual record's primary key
2) change RecordsetType
3) use the Me.Recordset.FindFirst method with the value stored in 1)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
That works perfectly, thank you. However, if I had a filter applied before I change the recordsetype, is there a way to pass that same filter on after the requery?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top