Connecting Tech Pros Worldwide Help | Site Map

Balance

Gx
Guest
 
Posts: n/a
#1: Nov 12 '05
I have this combo box with the following products to choose from:
A,B,C

Each has its own percentage buyback rate.
ie. A has 50% B has 25% C has 10 %
My problem is how to associate these percentage rates to the product chosen
from the drop down menu combo box.
eg. choose A in combo box,
then in the next field "Amount" you type $100
as a consequence the next field called "Buyback Balance" would then show
$50.
Can this be done in a query?


Larry Linson
Guest
 
Posts: n/a
#2: Nov 12 '05

re: Balance


If the buyback rates are in the table, or another table with a foreign key
to the product table, create an extra column in the RowSource of your Combo
box, for the buyback rate and in the AfterUpdate event of the Combo, set it
into another text box as (assuming it is the third column, which for coding
purposes are numbered from 0, but in the Properties box are numbered from
1 - only a little confusing)

Me!txtAnother = Me!cboSelectProduct.Column(2)

where, of course, you replace "txtAnother" with the name of the TextBox on
your Form and "cboSelectProduct" with the name of the Combo Box on your
Form.

Larry Linson
Microsoft Access MVP

"Gx" <sky5@optusnet.com.au> wrote in message
news:3f9516ee$0$10617$afc38c87@news.optusnet.com.a u...[color=blue]
> I have this combo box with the following products to choose from:
> A,B,C
>
> Each has its own percentage buyback rate.
> ie. A has 50% B has 25% C has 10 %
> My problem is how to associate these percentage rates to the product[/color]
chosen[color=blue]
> from the drop down menu combo box.
> eg. choose A in combo box,
> then in the next field "Amount" you type $100
> as a consequence the next field called "Buyback Balance" would then show
> $50.
> Can this be done in a query?
>
>[/color]


andybriggs
Guest
 
Posts: n/a
#3: Nov 12 '05

re: Balance



Assuming the two fields are called Percentage and Amount, create a new
field in the query by typing:



BuybackBalance:Amount*Percentage



This will re-calculate when you alter either Percentage or Amount, and
can, of course, be front-ended in a form.



Hope this helps.


--
Andy Briggs
Elmhurst Solutions Limited
http://www.elmhurstsolutions.com


Posted via http://dbforums.com
MeadeR
Guest
 
Posts: n/a
#4: Nov 12 '05

re: Balance


It sounds as if you entered the values into the list box - and did not
use a table to fill the list box - is that correct?? If so then there
is no way to use a query to determine the value.

If you create a table for A, B, C and have a field for the % then once
the user selects a value you can get the assoc. % from the table - or
could even use the % as the identifying field (if there are no two
values with the same %.


"Gx" <sky5@optusnet.com.au> wrote in message news:<3f9516ee$0$10617$afc38c87@news.optusnet.com. au>...[color=blue]
> I have this combo box with the following products to choose from:
> A,B,C
>
> Each has its own percentage buyback rate.
> ie. A has 50% B has 25% C has 10 %
> My problem is how to associate these percentage rates to the product chosen
> from the drop down menu combo box.
> eg. choose A in combo box,
> then in the next field "Amount" you type $100
> as a consequence the next field called "Buyback Balance" would then show
> $50.
> Can this be done in a query?[/color]
Closed Thread