How To Use Percent with a combo

  • Thread starter Thread starter David Whitaker
  • Start date Start date
D

David Whitaker

Hello All,
Hope All Is Well,
Now To The Problem,
I am wanting to use a combo box with preset values to fiqure percentage of a
textbox and put its result in another textbox.

Question 1
Can you use in the comboboxes rowsoure like the following:
..5%;.75%;1%;1.25% and so on

Question 2
how do you get Access to fiqure percentage, I could do this in Excel, but
this is not Excel.
I am trying to get the following
[me.cost] is what I am tring to get the percentage of

[me.rate] is the combobox with preset values representing percentage values,
also the code would be in the after update event

[me.result1] would be where the result would go.

Thanks for Your Time
David
 
David,

Set the rowsource for your combobox to Value List and put the following in the
rowsource:
..005,.5%;.0075,.75%;.01,1%;.0125,1.25% and so on

Note there are pairs of numbers where each number in the pair is separated by a
comma and each pair is separated by a semi-colon.

Set the Bound Column property to 1, Column Count property to 2 and the Column
Widths property to 0;.5. Your combobox will now display the second value in each
pair but use the first number to calculate when you make a selection.

Put the following code in the AfterUpdate event of the combobox:
Me!Result1 = Me!NameOfCombobox * Me!Cost
 
David,

I agree with PC, all except where it comes to putting your numbers in a
ValueList. I almost never use a value list, because you have to get into
the guts of the form to change the values. Instead, create a new table
(tbl_Percentages) with two columns, one for the actual value and the other
for the percentage figure. Now, when you want to change the values all you
have to do is open the table, add or delete the values.

HTH
Dale

PC Datasheet said:
David,

Set the rowsource for your combobox to Value List and put the following in the
rowsource:
.005,.5%;.0075,.75%;.01,1%;.0125,1.25% and so on

Note there are pairs of numbers where each number in the pair is separated by a
comma and each pair is separated by a semi-colon.

Set the Bound Column property to 1, Column Count property to 2 and the Column
Widths property to 0;.5. Your combobox will now display the second value in each
pair but use the first number to calculate when you make a selection.

Put the following code in the AfterUpdate event of the combobox:
Me!Result1 = Me!NameOfCombobox * Me!Cost

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com



Hello All,
Hope All Is Well,
Now To The Problem,
I am wanting to use a combo box with preset values to fiqure percentage of a
textbox and put its result in another textbox.

Question 1
Can you use in the comboboxes rowsoure like the following:
.5%;.75%;1%;1.25% and so on

Question 2
how do you get Access to fiqure percentage, I could do this in Excel, but
this is not Excel.
I am trying to get the following
[me.cost] is what I am tring to get the percentage of

[me.rate] is the combobox with preset values representing percentage values,
also the code would be in the after update event

[me.result1] would be where the result would go.

Thanks for Your Time
David
 
Thanks for the advice on how to fiqure percentages, but late last night I
finally fiqured out what PC was suggesting before I read the responses this
morning, I ended up doing as PC suggested and it works fine.
Both of you have good and valid ideals!
Keep up the responses!
David
 
Back
Top