I have Run-time error '3077' Syntax error (missing operator) in expression error come up when trying to .findFirst in my recordset.
It works ok when there are matching records. However, when it's a new record I get the error. I expect it not to find a record, but I don't want the error.
Does anyone know what's wrong with syntax? I also tried this:
Code:
'Criteria'
strCrit = "pkEventID = " & DMax("pkEventID", "tblEvents", "[fkAircraftID] = " & Me.cboTail & " AND [fldDateEnd] is null")
'Part of code'
.FindFirst strCrit
If .NoMatch Then
Resume Next
End If
It works ok when there are matching records. However, when it's a new record I get the error. I expect it not to find a record, but I don't want the error.
Does anyone know what's wrong with syntax? I also tried this:
strCrit = "pkEventID = " & DMax("pkEventID", "tblEvents", "[fkAircraftID] = " & Me.cboTail & " AND [fldDateEnd] is null") & ""