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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stop Combo From Displaying Decimals

Status
Not open for further replies.

SgtJarrow

Programmer
Apr 12, 2002
2,937
US
I have a combo box that no matter what I do displays decimal points. The table, set to no decimals, the query, no decimals, but the combo box shows decimals!!!! I need them to go AWAY!!! How can I accomplish this. There is no I in team. [elf]

Robert L. Johnson III, A+, Network+, MCP
robert.l.johnson.iii@citi.com
 
Hi,

I guess you already did that... But did you try
the ComboBox 'Decimal Places' property? You should set that to zero.

Hope it helps. Salvatore Grassagliata
GrassagliataS@hotmail.com
 
You should set the DecimalPlaces property in the table's property sheet. A bound control you create on a form or report inherits the DecimalPlaces property set in the field in the underlying table or query, so you won't have to specify the property individually for every bound control you create.

If the original table property sheet was set, for example, as Field Property: DOUBLE, Decimal Places: 2 and you change only the Decimal Places to zero, you will still see numbers to the right of the decimal in the combo box.

Now, if you change the Field Property: LONG INTEGER (for example) and save this, two things will happen:
1. you get an error message saying data will be lost, continue? (this will happen if you had any data to the right of the decimal in the live table data)

2. If you click on OK and open the table with the new Field Property name you will notice there are no decimal places, but rounded up or rounded down whole numbers.

Experiment with a fake table with one field to hold your number. Set it to the same properties as you had the original live data table. Make a form using only that field in a combo. Don't change the property sheet for the form.

I hope this helps.
 
Thanks for your suggestions, but alas, nothing worked.....

I created a blank table with two fields:
Double, Standard, 0 Decimal Places
Long Integer, Standard, 0 Decimal Places

Next I create a query from this table. Neither field shows any decimal places.

I created a form next. I create a combo box for each field from the table and the query. During the combo box wizard, no decimal places are displayed. But after I click finish, ALL of the combo boxes show decimals. Then I go into the query, the cobobox sources, and the cobobox details and set all to 0 decimals. Still seeing those pesky decimals.

Any other suggestions????????????? Need to fix this to give to client. There is no I in team. [elf]

Robert L. Johnson III, A+, Network+, MCP
robert.l.johnson.iii@citi.com
 
Well, after several hours of hunting this down, I finally found a solution that works.....

If I remove the format field (was stanard, now blank) the combo box works without the decimals.....fine except I need to show ,s and the like....So I set a custom format (#,##0) and it works great! No decimal points and the comma seperators are there.

Hope someone else can use this.... There is no I in team. [elf]

Robert L. Johnson III, A+, Network+, MCP
robert.l.johnson.iii@citi.com
 
I was going to suggest a custom format.

Oh and Robert, Though there is no I in team, there is an M and an E Craig, mailto:sander@cogeco.ca

Remember not to name the Lambs...
It only makes the chops harder to swallow
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top