run-time error 91 with recordset in form

piggitypow

Registered User.
Local time
Today, 14:51
Joined
Mar 19, 2005
Messages
19
I'm not a programmer but am putting together a search form. There was a search form sample shared on this site, and I've taken it and modified for my own use.

Here's how my version of the form is supposed to work:
When the user provides a text input for the search, a number of records that match the search criteria are displayed in the table. The user may select one of these records, and when they do so, the various fields of the record are displayed in editable text boxes below the table.

In my current form, the search works fine, but when the user selects a record, an error occurs and the record does not display in the text boxes underneath. It says: "run-time error 91: Object variable or With block variable not set"

The problem code is here, and the debugger points to the "Set rs=" line as the cause.

Private Sub QuickSearch_AfterUpdate()

Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[DocumentID] = " & Str(Me![QuickSearch])
Me.Bookmark = rs.Bookmark

End Sub

Any idea what could be causing this in my form? It works fine for the original version. I'm in Access 2003, and the form was made for Access 2000, if that makes any difference.
 

Users who are viewing this thread

Back
Top Bottom