I have used the following code:
Dim dbs as Database
Dim MyRs as Recordset
Dim strCriteria as String
Set dbs = CurrentDb
Set MyRs = dbs.OpenRecordset("Contacts", dbOpenDynaset)
strCriteria = "[CustID]= " & (Forms!Clients!CustID) & ""
MyRs.FindFirst strCriteria
Does anyone know any reason why, when [CustID]=Null, it works fine in one datbase, and yet put the same code into another databse and I get the following error on the MyRs.FindFirst line:
"3077: Syntax Error (missing operator) in expression"
I can see that it is because [CustID]="" but why it works fine in one situation and not another makes me want to scream. All references are the same and in identical order.
Dim dbs as Database
Dim MyRs as Recordset
Dim strCriteria as String
Set dbs = CurrentDb
Set MyRs = dbs.OpenRecordset("Contacts", dbOpenDynaset)
strCriteria = "[CustID]= " & (Forms!Clients!CustID) & ""
MyRs.FindFirst strCriteria
Does anyone know any reason why, when [CustID]=Null, it works fine in one datbase, and yet put the same code into another databse and I get the following error on the MyRs.FindFirst line:
"3077: Syntax Error (missing operator) in expression"
I can see that it is because [CustID]="" but why it works fine in one situation and not another makes me want to scream. All references are the same and in identical order.