How keep number field in a combobox from displaying decimals

SteveL13
SteveL13 used Ask the Experts™
on
I have a combobox that is displaying decimals in a field named 3DigitCode and I cannot figure out why.

Here is the SQL of the code behind the combobox:

SELECT tblPartNumberItemMasterTable.ItemMasterID, tblPartNumberItemMasterTable.[3DigitCode] AS Code, tblPartNumberItemMasterTable.DataMasterDescription1 AS [Description 1], tblPartNumberItemMasterTable.DataMasterDescription2 AS [Description 2]
FROM tblPartNumberItemMasterTable
ORDER BY tblPartNumberItemMasterTable.[3DigitCode];
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
format(3digitcode,"0")
Top Expert 2016
Commented:
open the table "tblPartNumberItemMasterTable" in design view
check the Field size setting of the field "3DigitCode", it should be Integer
Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012
Commented:
Set the rowsouce of the Listbox to something like this:
SELECT fld1, fld2, Round(YourNumberField,0) As YourRoundedNumber
From YourTable

This will keep the full number (including decimals) stored in the table,...but it will "appear" as a rounded whole number in the list box.

(Also make users are aware of the displayed rounding...)

Author

Commented:
Am going with the first solution but all 3 very worthwhile.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial