Seting format to be 000000000000000

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello Everyone,

I have got a field called "amount".

Currently it holds the following values 61025, 68653 etc

Is there any built in function which I can use to fill the field with
leading zeros?

Eg so it displays 00000000061025, 00000000068653.

Ideally I want to do this in a query without any manual steps as it will be
run by end users.

Kind Regards,
Beth
 
if the field is on a form and it is a text field that simply holds numbers
and the field length will always be 14 then you could put this in the after
update event of the field

YourField = Right("000000000000000" & [YourField],14)
 
Further to my last post, because you have this in the query section, add
columns to your query to do the same job

Padded1: Right("00000000000000" & [YourField],14)
 
You can try the following in your query or on a report:

NewAmount: Format([Amount],"00000000000000")

This will only work correctly for integers. If the field is set to double
or single then you would have to take the decimals into consideration on your
format.

Hope this helps.
 

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

Back
Top