Calculated field identifiers used in another calculated field

G

Guest

I'm trying to use the calculated value from one field in my query in another
calculated field within the same query. The first field calculates a number
for me; the second strings together the values from that field with another
(i.e. Expr2: [Field1] [Expr1]). My problem is that Access 2000 is treating
the field identifier (i.e. Expr1) as a parameter to be entered when the query
runs, though it recognizes the field taken from a table just fine. When using
the Expression Builder, Access clearly acknowledges that Expr1 is a field
name in the query, but when the expression used in Expr2 is parsed, Expr1 is
treated as a parameter (so a dialog box requesting the value of Expr1
appears).
 
A

Allen Browne

Under some conditions, you need to repeat the entire expression instead of
using the calculated field name.

For example, if the calculation is used for selecting (WHERE clause),
sorting (ORDER BY), grouping (GROUP BY clause), after grouping (HAVING
clause), or with some dependencies (even in the SELECT clause), repeating
the entire expression will solve the problem.
 
G

Guest

Under some conditions, you need to repeat the entire expression instead of
using the calculated field name.

For example, if the calculation is used for selecting (WHERE clause),
sorting (ORDER BY), grouping (GROUP BY clause), after grouping (HAVING
clause), or with some dependencies (even in the SELECT clause), repeating
the entire expression will solve the problem.

I could use an example of what you mean by the entire expression, if you
don't mind.
 
A

Allen Browne

Presumably you have a query in design view, that has something like this in
the Field row:
Expr1: [Quantity] * [PriceEach]

You are then trying to use Expr1 in another expression.
You need to replace [Expr1] in the 2nd expression with:
[Quantity] * [PriceEach]
 

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