Pad Leading Zeroes

aftershokk

Registered User.
Local time
Today, 21:58
Joined
Sep 5, 2001
Messages
259
I have a text field as 6 bytes but my vendor requires this field to be as shown in the example (sequential). Is their an easy to do this in the table?

000001
000002


000010
000011
thanks
 
use Integers with the format statement instead of text: Format(YOURNUMBERHERE, "000000")
 
?

Is this to be placed in a query?
 
either or. You can use it in a query, you can change the field definition in the table, or you can simply format your text box to show the proper format without changing your table or the underlying data
 
?

what does younumberhere stand for?

Actually key the number?

that would not work I want a nuber to be added sequentially for each record with padded zeroes based on lengh
 
OK, before I go off on a tangent...

Do you actually have this key field established (INCLUDING how to increment the number)?
 
answer

I have a 6 byte text field that I want to increment by 1 every time a record is added and padded with zeroes to fill all 6 bytes.

thanks for your help
 
OK...so we're starting from scratch.

Instead of a text field, make the field an auto number and primary key. With each new record, the number will increment.:
1 .......
2.......
3.........

Now in the format property of the field, enter 000000 and that will force the number to be displayed as six digits preceding the decimal.
000001............
000002............
000003............
 

Users who are viewing this thread

Back
Top Bottom