a DLookup() on a boolean field returns an Number value, either 0 or -1. you
should be able to assign this value to a variable with a data type of
Boolean, Integer, String, or Variant. perhaps the problem is in the
DLookup() function itself. in your code, try running the following code, as
Debug.Print DLookup("noContact", "TableInterviewStatus", _
"interviewId = '" & Me.TextStatusId & "' And visit = " _
& Me.TextStatusVisit)
open the Immediate window (Ctrl+g) to see the return value. if the function
generates the same error message, double check the TableInterviewStatus to
make sure that the interviewId field is Text data type, and the visit field
is a Number data type.
hth
"pokdbz" <(E-Mail Removed)> wrote in message
news:CD0878DA-5F45-4B04-A556-(E-Mail Removed)...
> I have this statement:
> Check = DLookup("noContact", "TableInterviewStatus", "interviewId = '" &
> Me.TextStatusId & "' And visit = " & Me.TextStatusVisit)
>
> noContact is a check box field it is giving me an error on this statment
> "Data type mismatch"
>
> I have tried Check as a bunch of different data types, integer, boolean,
> variant and text.
>
> Any idea what the problem is?
|