Hi,
am pretty new to access projects, and am having trouble making a calculation.
- I have a table (tbl_data) with these fields :
[field1(int)] ; [field2(int] ; [field3(boolean)]
- There is a table (tbl_settings) with these records :
[Name] ; [Value]
- I have also created a function "Coerce(x, min, max)"
that clips a integer with a min and max value.
What I want : To make a calculated text box in the bottom of my form. (Form = list of my records)
the calculation should be a sum of a calculation per record.
result = sum([field1])
This works
but I can't do anything more complex.
result = sum ([field2]-[field1]) or
result = sum ([field1]+1) give "#Error".
What can I do?
Put all calculations in a view?
But how then do I use the public vars and functions that I have?
can I e.g. use an iif-function in a view?
calculation that I need :
result = sum(coerce([field2]-[field1];iif(field3=true;' a looked up value from tbl_settings'; 'another looked up value from tbl_settings'; iif(field3=true;' a looked up value from tbl_settings'; 'another looked up value from tbl_settings' )
thx for all your help !
am pretty new to access projects, and am having trouble making a calculation.
- I have a table (tbl_data) with these fields :
[field1(int)] ; [field2(int] ; [field3(boolean)]
- There is a table (tbl_settings) with these records :
[Name] ; [Value]
- I have also created a function "Coerce(x, min, max)"
that clips a integer with a min and max value.
What I want : To make a calculated text box in the bottom of my form. (Form = list of my records)
the calculation should be a sum of a calculation per record.
result = sum([field1])
This works
but I can't do anything more complex.
result = sum ([field2]-[field1]) or
result = sum ([field1]+1) give "#Error".
What can I do?
Put all calculations in a view?
But how then do I use the public vars and functions that I have?
can I e.g. use an iif-function in a view?
calculation that I need :
result = sum(coerce([field2]-[field1];iif(field3=true;' a looked up value from tbl_settings'; 'another looked up value from tbl_settings'; iif(field3=true;' a looked up value from tbl_settings'; 'another looked up value from tbl_settings' )
thx for all your help !