Error 3071

S

stephanie duhau

I created a query for the sales by date by customer ID. My
query is as follow:
Customer ID
criteria : [Please enter Customer ID]

and I get the following message.
This expression is typed incorrectly, or it is too complex
to be evaluated. For example, a numeric expression may
contain too many complicated elements. Try simplifying the
expression by assigning parts of the expression to
variables. (Error 3071)

I believe that my problem is that the ID is in the
following format: 123ABC
How can I change my query to accept it?
 
A

Allen Browne

If this error occurs when you run the query directly (not through code), it
may help to explicitly declare the parameter for the query.

In query design view, choose Parameters on the Query menu.
Access opens a dialog with 2 columns.
Enter:
[Please enter Customer ID] Text
This should help 'unconfuse' JET about what data type is expected.
(It should also solve the problem if this is a crosstab query.)

It is always a good idea to declare your parameters, and it often helps JET
to understand the intended type. More examples in:
http://members.iinet.net.au/~allenbrowne/ser-45.html
 
S

stephanie duhau

Thank you very much.
So for any type of query it is advised to declare the
parameters?
-----Original Message-----
If this error occurs when you run the query directly (not through code), it
may help to explicitly declare the parameter for the query.

In query design view, choose Parameters on the Query menu.
Access opens a dialog with 2 columns.
Enter:
[Please enter Customer ID] Text
This should help 'unconfuse' JET about what data type is expected.
(It should also solve the problem if this is a crosstab query.)

It is always a good idea to declare your parameters, and it often helps JET
to understand the intended type. More examples in:
http://members.iinet.net.au/~allenbrowne/ser-45.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I created a query for the sales by date by customer ID. My
query is as follow:
Customer ID
criteria : [Please enter Customer ID]

and I get the following message.
This expression is typed incorrectly, or it is too complex
to be evaluated. For example, a numeric expression may
contain too many complicated elements. Try simplifying the
expression by assigning parts of the expression to
variables. (Error 3071)

I believe that my problem is that the ID is in the
following format: 123ABC
How can I change my query to accept it?


.
 
A

Allen Browne

stephanie duhau said:
Thank you very much.
So for any type of query it is advised to declare the
parameters?

Yes.

It's essential for crosstabs, but recommended for everything.
 

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