Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 363
  • Last Modified:

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_QualCriteriaReview", "[Subcode] = '" & Left([cboQualRevCriteria], 5) & "' And [Region] = '" & [Region] & "'")

What is wrong?

Thanks,

gdunn59
0
gdunn59
Asked:
gdunn59
1 Solution
 
als315Commented:
Try to change [Subcode] =
to
[Subcode] Like
0
 
RemRemRemCommented:
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
0
 
Nick67Commented:
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
0
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

 
gdunn59Author Commented:
I couldn't get it to work with any of the suggestions, so I just tried a different route.

Thanks everyone.

gdunn59
0
 
Nick67Commented:
@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
0
 
gdunn59Author Commented:
None of the other solutions worked, so I tried something else.  Thanks everyone for your assistance though!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now