Results 1 to 2 of 2

Thread: Leading "0"

  1. #1
    Join Date
    Jan 2004
    Location
    Houston, TX
    Posts
    29

    Angry Unanswered: Leading "0"

    Can anyone let me in on this secret? I have a text box which is bound to a number contol source.

    However when I enter a number such as "0625874" it records it as "625874" without the leading "0" is there a fix to this maddnes?

    Should I just use a text field? What are the consequences of doing such?

    Thanks!

    -Mr. Research

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1

    Re: Leading "0"

    Originally posted by MrResearch
    Can anyone let me in on this secret? I have a text box which is bound to a number contol source.

    However when I enter a number such as "0625874" it records it as "625874" without the leading "0" is there a fix to this maddnes?

    Should I just use a text field? What are the consequences of doing such?

    Thanks!

    -Mr. Research
    Access is trimming the leading zero because for all intents and purposes, 0625874 = 625874. The zero is essentially aesthetic. That said, it is easiest to simply store the number as 625874, then apply a display format of 0###### to any text box you would like to display the number in. That basically translates to "if there is no number in the first digit, display a zero instead".

    I should also add:

    If you're absolutely hell-bent on storing the "number" as 0625874, you could convert it to text and store it as a string.

Posting Permissions

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