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

Prefill with zeros

Status
Not open for further replies.

bzsurf03

MIS
Dec 13, 2002
75
0
0
US
In Access, how do you set the format of a 17-byte text field to prefill with zeros so the value will always be 17 bytes long not matter how short the value is?

Example:
Value is 1033 needs to be 00000000000001033.

Thanks in advance.
 


Hi,
Code:
Format([MyNumber],"00000000000000000")


Skip,
[sub]
[glasses] [red]Be Advised![/red] The Vinyards of Texas have produced a wine with diuretic dimishment and urethric relief...
Pinot More![tongue][/sub]
 
skip,

Where should i paste this? It didn't seem to work when I pasted into the format property of the field.

Here's some more info:

Field type = Text
Field length = 17
Field name = Total Amt

Thanks.
 


Its NOT a format - it's TEXT.

I'd use the Exit event to run a procedure like...
Code:
 [MyTextBox].Text = Format([MyTextBox].Text,"00000000000000000")



Skip,
[sub]
[glasses] [red]Be Advised![/red] The Vinyards of Texas have produced a wine with diuretic dimishment and urethric relief...
Pinot More![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top