Expression Error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've created the following expression in the design view of a query.

Expr: [Option1]*1+[Option2]*2+[Option3]*3+[Option4]*4+[Option5]*5+[Option6]*6

I get a message that "Option 1" etc can refer to multiple sources; e.g. the
Questions table and the Responses table. When I then specifiy Responses in
the cell below the formula, I get a syntax error.

Any ideas what is going on? Thanks much.
 
If both Questions and Responses have a field called [Option1], which one is
your expression referring to?

Try, instead, something like:

Expr: ([Responses]![Option1]*1)+([Responses]![Option2]*2)+ ...

By the way, if you have a null in any of these fields, your calculation
returns a null. Do you need to use the Nz() function also?

Regards

Jeff Boyce
<Office/Access MVP>
 
I got a missing parenthesis or invalid use of ! error message. Admitedly, my
eyes stink, but I can't see where I went wrong.

Expr1:([Responses]! [Option1]*1)+([Responses]! [Option2]*2)+([Responses]!
[Option3]*3)+([Responses]! [Option4]*4)+([Responses]!
[Option5]*5)+([Responses]![Option6]*6)

Jeff Boyce said:
If both Questions and Responses have a field called [Option1], which one is
your expression referring to?

Try, instead, something like:

Expr: ([Responses]![Option1]*1)+([Responses]![Option2]*2)+ ...

By the way, if you have a null in any of these fields, your calculation
returns a null. Do you need to use the Nz() function also?

Regards

Jeff Boyce
<Office/Access MVP>

JoLeigh said:
I've created the following expression in the design view of a query.

Expr:
[Option1]*1+[Option2]*2+[Option3]*3+[Option4]*4+[Option5]*5+[Option6]*6

I get a message that "Option 1" etc can refer to multiple sources; e.g.
the
Questions table and the Responses table. When I then specifiy Responses
in
the cell below the formula, I get a syntax error.

Any ideas what is going on? Thanks much.
 
Try replacing the exclamation marks with periods.
Also, there seems to be an extra space after each exclamation mark in what
you have posted. That alone could cause the failure.

([Responses].[Option1]*1)+([Responses].[Option2]*2)+([Responses].[Option3]*3)+([Responses].[Option4]*4)+([Responses].[Option5]*5)+([Responses].[Option6]*6)

JoLeigh said:
I got a missing parenthesis or invalid use of ! error message. Admitedly,
my
eyes stink, but I can't see where I went wrong.

Expr1:([Responses]! [Option1]*1)+([Responses]! [Option2]*2)+([Responses]!
[Option3]*3)+([Responses]! [Option4]*4)+([Responses]!
[Option5]*5)+([Responses]![Option6]*6)

Jeff Boyce said:
If both Questions and Responses have a field called [Option1], which one
is
your expression referring to?

Try, instead, something like:

Expr: ([Responses]![Option1]*1)+([Responses]![Option2]*2)+ ...

By the way, if you have a null in any of these fields, your calculation
returns a null. Do you need to use the Nz() function also?

Regards

Jeff Boyce
<Office/Access MVP>

JoLeigh said:
I've created the following expression in the design view of a query.

Expr:
[Option1]*1+[Option2]*2+[Option3]*3+[Option4]*4+[Option5]*5+[Option6]*6

I get a message that "Option 1" etc can refer to multiple sources; e.g.
the
Questions table and the Responses table. When I then specifiy
Responses
in
the cell below the formula, I get a syntax error.

Any ideas what is going on? Thanks much.
 
Back
Top