470,818 Members | 1,634 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,818 developers. It's quick & easy.

Query Should run but Data Type Mismatch error

I have been developing access databases for over 5 years.
I have a large database and I have struck this problem with it before
but can find nothing in help or online. Access 2000

I have a query that will run fine without any criteria but as soon as I
add any criteria it gives a "Data type mismatch" error.
As soon as I remove any criteria it runs perfectly.
I know this query is based on another query but I have other processes
based on this query with no issues.
I tried saving this query and basing another query on this one and got
the same error.
I have tried passing back variables from functions and still get a "Data
type mismatch"

eg: the following will run okay with the field b_cg_1 calculating
corectly as a boolean (-1,0)

SELECT qry_010_project_calc_base_forcast.*, CBool(nz([repl_cg_1],21)<20-
[element_base_life]) AS b_cg_1
FROM qry_010_project_calc_base_forcast

If I add the criteria below I get an error
WHERE (CBool(nz([repl_cg_1],21)<20-[element_base_life]))=True

When I run the following type of thing I get an error (typing from
memory)
SELECT qry_010_project_calc_base_forcast.*
FROM qry_010_project_calc_base_forcast
WHERE repl_cg_1 is not null

As an aside this is the database I could not set a breakpoint in VBA to
debug and had to import the entire contents into a new database to
eliminate this error and get breakpoints working again.

I hope someone has struck this issue before and has a fix as I look like
a bit of a noddy saying to my client that I believe I have discovered
and Access error.

TIA, Gavin.
Nov 13 '05 #1
0 2037

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Mark | last post: by
6 posts views Thread by Martin Lacoste | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.