Data type mismatch in criteria expression (1 Viewer)

joce

Registered User.
Local time
Today, 02:18
Joined
Oct 27, 2011
Messages
43
I am creating a simple query in a farm audit database.

In criteria of the customers field, i have entered "Farmer One" as this is the customers data which I want to retrieve and in the Totals section I have changed the setting to Where instead of group by, but I am still getting "Data type mismatch in criteria expression" popping up.

Can anyone help as to why this is???

Any help would be great
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 10:18
Joined
Sep 12, 2006
Messages
15,638
is the field TEXT or NUMERIC - ie - do you mean the number 1, rather than the text description "Farmer One"
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 10:18
Joined
Jul 9, 2003
Messages
16,271
>>>In criteria of the customers field, i have entered "Farmer One"<<<

When you run as a simple select query what results do you get?
 

Hey Lucy

Registered User.
Local time
Today, 02:18
Joined
Jan 20, 2012
Messages
124
vbaInet--

Read "The Evils of Lookup Fields in Tables". When users want a drop-down list to choose from (which may include hundreds of choices) I've only been taught to use Lookups. What is a better way? I'm getting a Data Mismatch when I try to write an expression on a form field and I do suspect the Lookup has something to do with it. Thanks!
 

Hey Lucy

Registered User.
Local time
Today, 02:18
Joined
Jan 20, 2012
Messages
124
Same problem here...but client has to have lookup field. However, it is the field with the lookup that I'm posting the criteria in. This is a real estate properties database and the Offer Status field is a lookup from the choices I created in the Offer Status table. When I try to run a query based on the criteria in the Offer Status field (criteria = Accepted), I get the data mismatch error. I am basing this query on two different tables. Any help is appreciated.
 

AlaQ

New member
Local time
Today, 02:18
Joined
Sep 25, 2013
Messages
1
I know this post is an old one but I guess this comment might be able to help others. Sometimes you might get this error if you are creating a table with an AutoNumber as the primary key, without noticing it you create a new record that have null values in all other fields except for the AutoNumber. Then when you run any criteria on any other field you will be specifying a criteria for a record that has null values, let's say on the firstname. In this case you will get this error eventually. So delete the last record and you will be fine to go.
 

Users who are viewing this thread

Top Bottom