Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text box calculation depending on checkbox....

Status
Not open for further replies.

adsfx

Programmer
Jun 4, 2003
237
GB
Hi,
On a form a user enters a value and then in an option group
selects wether they want the value to be treated as a 'percent' or as 'sterling'.

When the report is formatted I would like the text box which displays this value to do a calculation if the value is a percent "=([insurance])*([totsales])/100" or leave it alone if the value is sterling.

the option group is represented by a field in the table
with option1=sterling and option2=%

the value in the table is a general number

ne ideas?
thanx in advance Mark
 
Use the option group value in your IF or Case select code.
It will usually default to 1 if the first option is selected, 2 if the second option is selected etc and "" for no options selected. Check the properties for the option group name (eg id name is frame1 then value will be frame1.value etc).
Cheers
John




 
In the report text box's Control Source:

=IIF([OptionGroup] = 1, [insurance],([insurance])*([totsales])/100)

Hope this helps!

Anthony J. DeSalvo
President - ScottTech Software
"Integrating Technology with Business"
 
thanx very much both of ya!!
sorted- cheers ajdesalvo!
 
Hi,
I now want to sum each of those values depending on the criteria (1 OR 2) but cant get my head round it.

I tried setting criteria in a 'sum' query
[commselect]=1

do i need to use the query or report controls 'textbox'

cheers M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top