Hi Guys,
Can anyone see why the first line of this code would produce a "data mismatch type in criteria expression" error message.
Dim varx As Variant
varx = DCount("*", "[tblQuery]", "[EnQuiryId]='" & Me!Text3 & "'")
CurrentDb.Execute "UPDATE [tblQuery] SET [RecordId]=" & varx & " WHERE EnQuiryId='" & Me!Text3 & "' AND [RecordId] = 0"
I copied it from somewhere else where it works fine, all the fields are numbers. I cant get to the second line to see if that works.
Thanks in advance.
Can anyone see why the first line of this code would produce a "data mismatch type in criteria expression" error message.
Dim varx As Variant
varx = DCount("*", "[tblQuery]", "[EnQuiryId]='" & Me!Text3 & "'")
CurrentDb.Execute "UPDATE [tblQuery] SET [RecordId]=" & varx & " WHERE EnQuiryId='" & Me!Text3 & "' AND [RecordId] = 0"
I copied it from somewhere else where it works fine, all the fields are numbers. I cant get to the second line to see if that works.

Thanks in advance.