Changing sign of a value in calculated field

J

jaworski_m

I have a calculated field on a form (form and calculated field are based on a
query).

[result] = [value1]*[value2]

There is an option group on the form:
1 - option 1
2 - option 2

I would like the [result] to became negetive when "2 - option 2" is chosen,
but I get an error message that [result] field cannot be modified.

How can I solve this problem?

Thank you for suggestions.

Access 2003
win XP
 
J

John W. Vinson

I have a calculated field on a form (form and calculated field are based on a
query).

[result] = [value1]*[value2]

There is an option group on the form:
1 - option 1
2 - option 2

I would like the [result] to became negetive when "2 - option 2" is chosen,
but I get an error message that [result] field cannot be modified.

How can I solve this problem?

Thank you for suggestions.

Access 2003
win XP

Include the option group in the calculation directly:

[result] = [value1]*[value2]*IIF([Optiongroup] = 1, 1, -1)
 

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