Run an Update query on your table. Modify the following
Zip Code example to your specifics.
Table: Employees
Field: Postal Code
Update To: "0" & [Employees]![PostalCode]
Criteria: Len([Employees]![PostalCode])<> "5"
Obviously, in your case, the last line would be <> 6
Roxie Aho
-----Original Message-----
How can I pad a string with leading 0's in a table if the string doesn't
equal 6 characters ?
string = Right("000000" & string, 6)
If it's a numeric value:
string = Right("000000" & trim(str(value)), 6)
In this case it will give you a string return of '001234' of whatever value
you have.
Note: if value is decimal, take into consideration the decimal point and the
decimals or make it integer first.
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.