Forum Discussion

TraciSchefdore's avatar
TraciSchefdore
Qrew Trainee
8 years ago

Add leading zeros to Form ID # to make even length

I am using the following formula to add leading zeros to a request # field I created on a form.

"Request"&Right("000" & ToText([Record ID#]),5)

I would like to limit the number of characters to 11 and have the leading zero's be consumed as the record id # increases.

For example:

"Request00012" should be "Request0012"

Is there a way I can modify the field or form to do this?

3 Replies

  • MCFNeil's avatar
    MCFNeil
    Qrew Captain
    You are going to have to account for growing numbers.

    Something like...
    If([Record ID#]>99, ...
    If([Record ID#]>999, ...
    If([Record ID#]>9999, ...
    etc.