I'm having issues using FindFirst with a variable in one of my recordsets. I have the following code:
-
Dim db As DAO.Database
-
Dim rcdsetActive As DAO.RecordSet
-
Dim acctID As String
-
-
acctID = Me.ID
-
'ID of current record. Autonumber
-
-
Set db = CurrentDb
-
Set rcdsetActive = db.OpenRecordset("SabreUsers", dbOpenDynaset)
-
-
rcdsetActive.FindFirst ("[ID] = '" & acctID & "'")
-
If Not rcdsetActive.NoMatch Then
-
rcdsetActive.Edit
-
rcdsetActive!FirstName = "OPEN"
-
rcdsetActive.Update
-
End If
-
When I run this I get a runtime error 3464, data type mismatch in criteria expression, with the FindFirst line highlighted in the debugger. I have a form showing active users of an application and want to open the recordset and edit the current record. ID is the primary key. I set the string variable acctID equal to the record ID and want to pass it to the FindFirst function. Any thoughts on what's going wrong?