need to refresh and have it stay at same record

cliff7376

Registered User.
Local time
Today, 17:44
Joined
Oct 10, 2001
Messages
107
I have a refresh button with this code in it.
Dim key As String
Dim stDocName As String

key = Me!primary

stDocName = "filter"
DoCmd.RunMacro stDocName

DoCmd.GoToRecord acDataForm, "certifications", acGoTo, key

the purpose of it was to put the record number in a variable. refresh the screen and then go to that record. it works fine until i get up to my 11500 record or so then it tells me "you can't go to that specified record. What am I doing wrong?
 
i just found my problem but i dont know how to fix it. i want to have the code say gotorecord where primary field = varialble. can anyone help.
 
Give this a try...

Dim key As String
Dim rs As Object
Dim stDocName As String

key = Me!Primary

stDocName = "filter"
DoCmd.RunMacro stDocName

Set rs = Me.Recordset.Clone
rs.FindFirst "[PrimaryKey] = '" & key & "'"
Me.Bookmark = rs.Bookmark

[This message has been edited by Jack Cowley (edited 11-10-2001).]
 

Users who are viewing this thread

Back
Top Bottom