Solved

Getting Datatype Mismatch in my DLookup

Posted on 2011-03-01
6
347 Views
Last Modified: 2012-05-11
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
Comment
Question by:gdunn59
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 40

Expert Comment

by:als315
ID: 35010291
Try to change [Subcode] =
to
[Subcode] Like
0
 
LVL 7

Expert Comment

by:RemRemRem
ID: 35010335
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
 
LVL 26

Expert Comment

by:Nick67
ID: 35011211
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Accepted Solution

by:
gdunn59 earned 0 total points
ID: 35024092
I couldn't get it to work with any of the suggestions, so I just tried a different route.

Thanks everyone.

gdunn59
0
 
LVL 26

Expert Comment

by:Nick67
ID: 35085061
@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
 
LVL 1

Author Closing Comment

by:gdunn59
ID: 35120696
None of the other solutions worked, so I tried something else.  Thanks everyone for your assistance though!
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question