I am assigning a value to a variable from a Dlookup, I have used this before with no problems until now, it keeps returning the error of data mismatch but I can't see one anywhere:
CPName is a text field
CarPark is the table
CPCounter is a number field
This should return the string value of CPName from CarPark where the CPCounter matched 1
Code:
Dim n As Integer
Dim Temp As String
n=1
Temp = Nz(DLookup("[CPName]", "CarPark", "[CPCounter] = '" & n & "' "), 0)
It keeps giving the data mismatch error message but I can't see where the problem is, please help if you can!