cravincreeks
Technical User
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
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