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

Error when attempting to set bookmark

Status
Not open for further replies.

cravincreeks

Technical User
Jun 18, 2004
85
US
Hello all

I'm working on a legacy database created by another person. It has a form whose record source is a select query. The form has a combo box, which is not bound to the record source, on it that can be used to 'jump' to a record in the query by typing a unique file number into it.

Here is the code attached to the combobox:
Sub Combo373_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[filenum] = '" & Me![Combo373] & "'"
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub

This code used to function properly, but doesn't after I made some changes to the form's code, described below


The form also has several tabs (pages). On this tab is a check box linked to a number field (0 or -1). I need to detect when this check box is checked and update a date column in the forms current record record. To do this, I set a boolean variable declared at the form level to true in the check box's OnClick event. Then in the form's AfterUpdate event, I grab the filenumber out of a bound text box on a different tab/page and use ADO to run an update query on the underlying table. To do this, I have to set the focus to the text box so I can obtain the file number and this may be the root of my problem.

Then when the user attempts to type a file number into the unbound combo box, I get the following error on the line from above that reads 'Me.Bookmark = Me.RecordsetClone.Bookmark': 'Object invalid or no longer set'

Does this have to do with the fact that I changed the focus to the bound text box on a different tab/page? How can I get around this problem? The user really wants this functionality to continue.

Thanks!

Alex

 
run an update query on the underlying table
You may have to use Me.Refresh after that.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top