Format Combo values with padding

G

Guest

Hi,
Can I format the values (number) in a combo list with leading zero? For
example, my value on the combo is 06010001, but the leading zero does not
show. I can format the combo's property to "00000000" and after the combo's
update, the leading zero will show. But the leading zero does not show when I
click on the dropdown arrow of the combo list. So, is it possible to pad the
list with leading zeros as I click on the dropdown arrow to select from a
list? Any advice is greatly appreciated.
 
D

Douglas J. Steele

Format the number in a query, and use that query as the row source for the
combo.
 
K

Ken Snell \(MVP\)

Set the format of the field in the query that is the combo box's Row Source.
 
G

Guest

Change the RowSource of the combo to

Select Format([FieldName],"00000000") As NewName From TableName
 
G

Guest

Hi Samantha

Usually you want to use a combo, so you store an Id in the main table, and
use another table to retrieve the description.
By using the format in the combo, and storing the value with leading zero's
when the detailed table has it as number, might cause truble later on.
Such as, creating a query and linking the two tables.

You better off, changing the type of the field in the table that you using
in the table, and updating it to have leading zero's, the same as the value's
you are storing in themain table.

I hope that make sense to you, sometimes it's deficult for me to explain
things in english.

--
\\// Live Long and Prosper \\//


Ofer said:
Change the RowSource of the combo to

Select Format([FieldName],"00000000") As NewName From TableName

--
\\// Live Long and Prosper \\//


Samantha said:
Hi,
Can I format the values (number) in a combo list with leading zero? For
example, my value on the combo is 06010001, but the leading zero does not
show. I can format the combo's property to "00000000" and after the combo's
update, the leading zero will show. But the leading zero does not show when I
click on the dropdown arrow of the combo list. So, is it possible to pad the
list with leading zeros as I click on the dropdown arrow to select from a
list? Any advice is greatly appreciated.
 
G

Guest

Thank you ALL for your quick responses. I formatted the field on the
rowsource and works like a charm! thanks again.

Ofer said:
Hi Samantha

Usually you want to use a combo, so you store an Id in the main table, and
use another table to retrieve the description.
By using the format in the combo, and storing the value with leading zero's
when the detailed table has it as number, might cause truble later on.
Such as, creating a query and linking the two tables.

You better off, changing the type of the field in the table that you using
in the table, and updating it to have leading zero's, the same as the value's
you are storing in themain table.

I hope that make sense to you, sometimes it's deficult for me to explain
things in english.

--
\\// Live Long and Prosper \\//


Ofer said:
Change the RowSource of the combo to

Select Format([FieldName],"00000000") As NewName From TableName

--
\\// Live Long and Prosper \\//


Samantha said:
Hi,
Can I format the values (number) in a combo list with leading zero? For
example, my value on the combo is 06010001, but the leading zero does not
show. I can format the combo's property to "00000000" and after the combo's
update, the leading zero will show. But the leading zero does not show when I
click on the dropdown arrow of the combo list. So, is it possible to pad the
list with leading zeros as I click on the dropdown arrow to select from a
list? Any advice is greatly appreciated.
 

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