Percentages in option groups

Sam Summers

Registered User.
Local time
Today, 08:15
Joined
Sep 17, 2001
Messages
939
Been searching for an answer to this one but still cant quite get it.

I am using an option group to subtract and add percentages on an amount in a text box. This is the code i am using but there is something wrong. My syntax is out.

Me.TechsRate = ((Me.Chargeout.Text - (Me.Option17.OptionValue /100))

I am trying to calculate 5% or 10% or 15% and so on, up to 35%

Thank you in advance
 
What is the name of your option group? Is it Option17?
 
Hi Ken,

Its just the default name - Frame12
 
Sam Summers said:
Hi Ken,

Its just the default name - Frame12

So I would think you'd need something like the following if you want a percent of the Chargeout value based on the option group value:


Me!TechsRate = Me.Chargeout*(Me!Frame12 * .01)


???
 
There are 6 buttons in the group though and each is a different %.

A user enters a value into one textbox and then clicks on the appropriate button in the option group and this % is then added or subtracted to produce a value in a second textbox
 
Hi Sam
Ken, I hope you don't mind me "butting in" here...

I have attached a DB with an unbound form that I think solves the problem.
Each of the toggle buttons in the option group has been created with it's value being set at the % rate described by it's label. There is a tick box to select whether to add or subtract the % applied and the two text boxes that you describe in your post.

The basic % formula is TechRate = Chargeout + (Chargeout*Frame12/100)

Whether the % is added or not is evaluated by the tickbox (Tick1) where "ticked" = True will Add.
The Controlsource for the TechRate field is set to:
=iif(Tick1=True, Chargeout + (Chargeout*Frame12/100), Chargeout - (Chargeout*Frame12/100))

I created this in Access 2002, but saved it in 2000 format - I hope you will be able to read it.

HTH
Regards
Rod
 

Attachments

Rod D said:
Hi Sam
Ken, I hope you don't mind me "butting in" here...
Rod

Not at all - I wasn't explaining myself very well...:o
 
Thanks very much for that. I'll try it and let you know how i get on.
 
Right, got it thanks.

What i did was for each of the option buttons iused this based on your expression.

Me.TechsRate = Me.Chargeout + (Chargeout * 5 / 100)

increasing it for each percentage for each option button i.e

Me.TechsRate = Me.Chargeout + (Chargeout * 10 / 100)

Me.TechsRate = Me.Chargeout + (Chargeout * 15 / 100)

etc. - Works perfect
 

Users who are viewing this thread

Back
Top Bottom