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!

Bookmark question

Status
Not open for further replies.

jgarnick

Programmer
Feb 16, 2000
189
US
I have a form with a combo box that is used to lookup names. After looking up several names in a row and sometimes editing their other fields on the form, I get a run-time error 2105 error saying I can't go to the specified record, I may be at the end of a recordset. I have the code below on the On Change, On Exit and On Dblclick properties of the combo box. Why do I get the run-time error?

Private Sub Combo138_Change()
Me.RecordsetClone.FindFirst "[ID] = " & Me![Combo138]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

Thanks--

jgarnick
jgarnick@aol.com

 
Not sure what you got ther but I have had a lot of success with this:

Dim FormName As String, SyncCriteria As String
Dim f As Form, rs As Recordset

' form name to be syncronized
FormName = "AutoCAD"

'Define the form object and recordset object for the AutoCAD form
Set f = Forms(FormName)
Set rs = f.RecordsetClone

' define the criteria used for the sync
SyncCriteria = "[Part_num]=" & Chr$(39) & Me![Part_num] & Chr$(39)

' find the corresponding record in the Parts table
rs.FindFirst SyncCriteria
f.Bookmark = rs.Bookmark

DougP, MCP
dposton@universal1.com

Ask me how Bar-codes can help you be more productive.
 
I use the same code, and got an error 2105 too.
during debugging I noticed that "frmActive.Bookmark = strBookmark" did not work the first time, now I execute it twice and everything works fine.
I figured this out when I still used access 2.0, must be 5,6 years ago. Wow what a great bug, it still works in access 2000 :)

Set rst = frmActive.RecordsetClone
strWhere = "[" & strPrimaryKey & "]=""" & cbo.Value & """"
rst.FindFirst strWhere
strBookmark = rst.Bookmark
frmActive.Bookmark = strBookmark
frmActive.Bookmark = strBookmark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top