Leading zeroes dropped in combination box

K

Karl H

Hi,
My table has a 5 digit number that keeps leading zeroes by formating the
data with "00000"

When I use a combination box to retrieve the data, the leading zeroes are
dropped, despite formatting the text box to "00000"

The text box control source is: =[cboDesigNo].[Column](2)

Is there a way to format this to retain leading zeroes, short of changing
the data in the original table to text?
Thank you,
Karl
 
J

John Spencer

Try

=Format([cboDesigNo].[Column](2),"00000")

Or in the combobox's row source use the format function in the query to
force the field to a string value formatted as 00000.

The best solution in my opinion is to store the value as a string. Unless
you are planning to do math on the value it makes little sense to me to
store a fixed number of numeric characters as anything other than a string.
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
K

Karl H

Hi John,
This works great, too. I think you're right about storing it as a string. I
just have some applications out there where the backed-up data is already a
number, so I'm concerned the data will not import correctly if I change it to
a string, now. In the future, that's what I'll do.
Thank you!
Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top