Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2014
    Posts
    12

    Unanswered: Number with leading alpha and padded zeros

    I have a primary key in which
    • The first 3 letters are constant, "EDR"
    • The numeric portion is 8 digits
    • The number needs to pad with zeros from left to right if whatever is input is less than 8 digits
    • The total primary key length is 11 characters: 3 letters and 8 numbers.


    How do I "make Access" do this? See concrete example below.

    Right now I have an input mask of, "EDR"########!;0;_
    Although the exclamation point forces the number to right justify, it still leaves blank spaces between the number and EDR if the number length is less than 8 digits. If my number is EDR00058427, how can I simply input 58427 and have the result not be EDR 58427, but EDR00058427?

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Try: "EDR"000000000;0;_
    Have a nice day!

  3. #3
    Join Date
    Jun 2014
    Posts
    12
    Thank you for your tip! When I tried that, with a short number, 12345, expecting the left side of the number to pad with 3 zeros, preceded by EDR (that is, EDR00012345), I got the following error message:

    "The value you entered isn't appropriate for the input mask '"EDR"00000000;0;_' specified for this field."

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    See the attached screeshot of what I get when I try.
    Attached Thumbnails Attached Thumbnails ScreenShot003.jpg  
    Have a nice day!

  5. #5
    Join Date
    Jun 2014
    Posts
    12
    I finally got it! I had already established a relationship with the field as a text, so I couldn't do the number format. I tested it in another field though, and was able to replicate what you illustrated. Thank you for your help!
    Last edited by dijilator; 07-01-14 at 18:29. Reason: Was able to follow the instructions and resolve the issue.

  6. #6
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You're welcome!
    Have a nice day!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •