In the following code I am attempting to open a query and edit the
lastMaintenance field for a particular equipment number. My code looks like
this:
Dim db As Database
Dim rs As Recordset
Dim SQL As String
Set db = DBEngine.Workspaces(0).Databases(0)
Set rs = db.OpenRecordset("SELECT * From qryPlannedMaintenance WHERE
[EquipmentNumber] = '" & EquipmentNumber & "';")
rs.MoveFirst
rs.Edit
rs![LastMaintenance] = Date
rs.Update
rs.Close
Set rs = Nothing
Set db = Nothing
At the moment I am getting this run time error on the Set rs line:
Run-time error 3464. Data type mismatch in criteria expression.
Any suggestions?
Thanks in advance