Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Getting Datatype Mismatch in my DLookup

Posted on 2011-03-01
6
Medium Priority
?
358 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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

647 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