Data type mismatch in criteria expression

G

Guest

I have looked all over this board and have not found a solution to my issue.
I have query that uses a form for criteria selection. The criteria come from
combo boxes located on this form. For some reason today this query has
stopped working. So I took the time to completely rebuild this query from
the gound up. Now when I run the query it works fine (displays the expected
results based on the form criteria) for half a second. Then out of no where
it gives me the "Data type mismatch in criteria expression" and converts all
of the data displayed in my query to "#Name?" error. Is there anything that
I can do to stop this from happening? Thanks in advance.
 
J

james.igoe

My first guess is that underlying value is null, and one of the
underlying equations relies on this, then fails as ERROR.

If so, you can use a function to provide a default value, either as an
IIF statement, or via NZ(value, value if null). In this way uyopu can
prvent the problem, but you can go further and check/prvent the
problem from entering your system, but you would need to find the
cause of the error.

One way to find the problem is to make a copy of the query, then
selectively remove columns until the problem no longer occurs...
 
J

John W. Vinson

I have looked all over this board and have not found a solution to my issue.
I have query that uses a form for criteria selection. The criteria come from
combo boxes located on this form. For some reason today this query has
stopped working. So I took the time to completely rebuild this query from
the gound up. Now when I run the query it works fine (displays the expected
results based on the form criteria) for half a second. Then out of no where
it gives me the "Data type mismatch in criteria expression" and converts all
of the data displayed in my query to "#Name?" error. Is there anything that
I can do to stop this from happening? Thanks in advance.

Correct the error in the query... which we will gladly help you do, if you'll
post the SQL view of the query so we can see what the error might be!

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top