Recordset.findfirst

AceBK

Registered User.
Local time
Today, 03:08
Joined
Dec 2, 2011
Messages
75
I have a table called "Company", in this table is a list box of different dockets. When I click on one of the items in the list box, I get taken to my "JobsList" form and it get filtered by the "DocketNumber" that I picked in the list box. So to flesh that out, I have 15 dockets in my "JobsList" table, but when I click the list box, it filters the JobsList table to one. When I am on the Jobslist form though, I want to take the filter off while staying on the record that I selected from the listbox. Below is the code that I used, and it worked, but now all of a sudden it doesn't work.

Dim ID As Variant
ID = DocketNumber.Value
Forms(Jobslist).FilterOn = False
Forms(Jobslist).Recordset.FindFirst "[DocketNumber]=" & ID

The error I get when I click the "Unfilter" button is
Run-time error '3070':
The Microsoft Access database engine does not recognize [DocketNumber] as a valid field name or expression"

Does anyone know why this might all of a sudden be happening?
 
if it is suddenly happening then you've changed the name or removed it from your recordset.
 
I thought of that, but "DocketNumber" is the name of the field that I am trying to find the first record of. It is still there and the name did not change
 
Can you post a copy of the db in zip format?
Remove anything confidential/private and tell readers how exactly to get to the problem code.

You may have to have quotes around the form name (untested)
Forms("Jobslist").Recordset.FindFirst "[DocketNumber]=" & ID
 

Users who are viewing this thread

Back
Top Bottom