Error 3071

  • Thread starter Thread starter stephanie duhau
  • Start date Start date
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?
 
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
 
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?


.
 
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

Similar Threads

Error 3071 1
Subform not populating 5
Complicated elements in a table 9
run-time error 3071 3
Expression error 7
Wildcards in IIF statements 3
Criteria Search stopped working 5
expression error 4

Back
Top