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

4 Digit Number

Status
Not open for further replies.

Costefran

Technical User
Jan 2, 2008
197
GB
Hello

Can anyone help with the following

I have a form link to a table that generates an auto number on a control (based on various form events) which is then stored in the forms underlying record source (which is a table)

I would like the entry to be represented as a four digit number so if 1 is the control value then the number would be represented as
0001
and if 11 then
0011
and if 222 then
0222

Am not sure how to do this so any suggestions would be well received

thanks
 
Change your format of your textbox to 0000

ck1999
 
A format will not be stored in the table, which may or may not suit.
 




Keep in mind that the NUMBER 1 does not have any leading zeros It's value is BINARY 1

The STRING of NUMERIC DIGITS 0001 has a WAAAAAAAAAY different BINARY VALUE than the number 1 and the BINARY VALUE cannot be used for arithmetic calculations.

You can take a NUMBER, and DISPLAY it with leading zeros, without changing the underlying value, which is essentially what a DISPLAY FORMAT does for a number.

Skip,

[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top