Connecting Tech Pros Worldwide Forums | Help | Site Map

Wierd Combo Box Behaviour!

Newbie
 
Join Date: Jun 2007
Posts: 14
#1: Jul 17 '07
I have created a combo box with the following properties:

RowSourceType: Value List
RowSource: "0%";"10%";"25%";"36%";"37%"
Bound to column: 1
Limit to List = Yes
Default Value = None
Format: Percent
Decimal Places: 0
Column Count: 0
Control Source: Discount field in a table.

When i load the form and select a value from the combo box, only "0%" appears. I am able to view all other percentages, but when i select any one of them, only 0% appears. I have no clue why is this happening.

Now, if i change the Bound to Column property to 0, then i am able to select the value normally. So, if i select 10% from the list, 10% appears in the combo box.

I am ok to set the Bound to column property to 0, but the problem comes when i need to calculate the discounted price. I have a function that takes the value from this combo box and then calculates the price.

When the Bound to column property is set to 0, the compiler takes the position of the value in the list. So if i select 10%, the cmbDiscount.value displays 2 and not 10%.

I am getting really frustated and don't know what to do. Does anyone has suggestions??

nico5038's Avatar
Moderator
 
Join Date: Nov 2006
Location: The Netherlands
Posts: 2,232
#2: Jul 18 '07

re: Wierd Combo Box Behaviour!


Quote:

Originally Posted by RamanS

I have created a combo box with the following properties:

RowSourceType: Value List
RowSource: "0%";"10%";"25%";"36%";"37%"
Bound to column: 1
Limit to List = Yes
Default Value = None
Format: Percent
Decimal Places: 0
Column Count: 0
Control Source: Discount field in a table.

When i load the form and select a value from the combo box, only "0%" appears. I am able to view all other percentages, but when i select any one of them, only 0% appears. I have no clue why is this happening.

Now, if i change the Bound to Column property to 0, then i am able to select the value normally. So, if i select 10% from the list, 10% appears in the combo box.

I am ok to set the Bound to column property to 0, but the problem comes when i need to calculate the discounted price. I have a function that takes the value from this combo box and then calculates the price.

When the Bound to column property is set to 0, the compiler takes the position of the value in the list. So if i select 10%, the cmbDiscount.value displays 2 and not 10%.

I am getting really frustated and don't know what to do. Does anyone has suggestions??

Did you try:
RowSource: 0;10;25;36;37

Nic;o)
NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Posts: 15,745
#3: Jul 19 '07

re: Wierd Combo Box Behaviour!


Quote:

Originally Posted by nico5038

Did you try:
RowSource: 0;10;25;36;37

Nic;o)

You specified an array of string items rather than numbers.
You can see them, but they have no numerical value when you try to process them.
Reply