ACC: Query with Expression on Expression Prompts for Parameter (119755)
The information in this article applies to:
- Microsoft Access 1.1
- Microsoft Access 2.0
- Microsoft Access for Windows 95 7.0
- Microsoft Access 97
This article was previously published under Q119755
Moderate: Requires basic macro, coding, and interoperability skills.
SYMPTOMS
When you run a query, Microsoft Access prompts you to enter a parameter
value even though you have not defined a parameter in the query.
CAUSE
This behavior can occur if you create a calculated field with an expression
based on another expression on the query, and this field has a sort
order or criteria. Microsoft Access supports referencing column aliases
only in other field cells.
This can be seen most easily in the query's SQL view. The Select list can
include expression names, but other clauses, such as WHERE and ORDER BY,
cannot.
RESOLUTION
There are two ways to work around this behavior:
- Substitute the first expression for the first expression's name in the
second expression.
- Create a second query based on the initial query and include the sort
order and criteria in the second query.
Please see the "Steps to Reproduce Behavior" section of this article for
examples of these two methods.
REFERENCES
For more information about calculated fields in queries, search the Help
Index for "Calculated fields," or ask the Microsoft Access 97 Office
Assistant.
Modification Type: | Major | Last Reviewed: | 5/6/2003 |
---|
Keywords: | kbprb KB119755 |
---|
|