gdunn59
asked on
Getting Datatype Mismatch in my DLookup
I have the following DLookup and I keep a "Datatype Mismatch" error.
Me.Possible_Score = DLookup("[Possible Score]", "tblEnrollment_QualCriteri aReview", "[Subcode] = '" & Left([cboQualRevCriteria], 5) & "' And [Region] = '" & [Region] & "'")
What is wrong?
Thanks,
gdunn59
Me.Possible_Score = DLookup("[Possible Score]", "tblEnrollment_QualCriteri
What is wrong?
Thanks,
gdunn59
That error usually means you're getting a mismatch between, say, a numeric value and a text value. For example, is the [Subcode] field numeric and the first 5 characters are supposed to be, but perhaps include something that has an "o" instead of a zero in it?
-Rachel
-Rachel
Your
Left([cboQualRevCriteria], 5
is that string data or number data?
If it is a number then use CInt( Left([cboQualRevCriteria], 5)
if its alphanumeric try Chr(34) & Left([cboQualRevCriteria], 5) & chr(34)
chr(34) is quotation marks "
I like Chr(34) & somestringvariable & chr(34) better than trying to get double sets of quotes to work.
Less frustration and easier to troubleshoot
Left([cboQualRevCriteria],
is that string data or number data?
If it is a number then use CInt( Left([cboQualRevCriteria],
if its alphanumeric try Chr(34) & Left([cboQualRevCriteria],
chr(34) is quotation marks "
I like Chr(34) & somestringvariable & chr(34) better than trying to get double sets of quotes to work.
Less frustration and easier to troubleshoot
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@gdunn59
It's ok if you went a different route, but post up what you did do.
That way everyone who may happen to google across your question finds an answer.
Nick67
It's ok if you went a different route, but post up what you did do.
That way everyone who may happen to google across your question finds an answer.
Nick67
ASKER
None of the other solutions worked, so I tried something else. Thanks everyone for your assistance though!
to
[Subcode] Like