1
votes

I have a table Part_Information in which PartNumber is a text field. On a form when user enters PartNumber in textbox I need to check whether that partNumber exists in table or not. I am using Dcount method.

DCount(" PartNumber ", "Part_Information", "PartNumber = " & Me.CurrentPartNumber) = 0 

but it gives error 3464 saying data type mismatch in criteria expression.

1

1 Answers

2
votes

If PartNumber is a text field, you have to quote the criteria like this:

DCount("PartNumber","Part_Information","PartNumber='" & Me.CurrentPartNumber & "'")