Results 1 to 4 of 4
  1. #1
    Pegasus_Angel is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    2

    Exclamation Trying to get leading zeros to show

    I have been working in Access 2007 creating a database. For the most part I've been able to figure everything out but I have a field where I'm putting a three digit code. It has an input mask, that is set as a text file, and is "000". I thought that would force all three numbers to show even if there was a zero in front.

    However, the leading zeros are being removed and I can't figure out how to make them stay so that I can see them. Does someone have simple explanation on how to fix it?

    Just so you know I'm just learning access so the more detailed the answer the easier it will be for me to understand.

  2. #2
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254
    Pegasus_Angel -

    You may want to look at the field in the table's design view. If the data type is "Number", then, despite the input mask, when saved, the leading zeros will be removed. Back-up the DB first then, go to the table in design view. Change the datatype to text, change the format property to 000 and see if that resolves the issue.

    All the best,

    Jim

  3. #3
    Pegasus_Angel is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    2
    Quote Originally Posted by ketbdnetbp View Post
    Pegasus_Angel -

    You may want to look at the field in the table's design view. If the data type is "Number", then, despite the input mask, when saved, the leading zeros will be removed. Back-up the DB first then, go to the table in design view. Change the datatype to text, change the format property to 000 and see if that resolves the issue.

    All the best,

    Jim
    Jim,

    What I'm trying to fix is in a subforum and I'm not quite sure how to change it. I can tell it clearly is a 'numerical box' as the only format I can choose is number related but I'm not sure how to change it back to text.

    Would I need to restart my whole form?

  4. #4
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254
    Pegasus_Angel - I don't think you need to re-create the subform. Personally, I would backup the DB then, go to the subform in design view and delete that control from the subform. Next, I would go to the table in design view and make the changes I suggested earlier. Then, I would add that control back into the subform. Post back if you encounter any problems.


    Jim

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Importing data with leading zeros
    By buckychudd in forum Import/Export Data
    Replies: 7
    Last Post: 11-04-2011, 12:26 PM
  2. Leading Zeros
    By dirtbiker1824 in forum Access
    Replies: 1
    Last Post: 03-14-2011, 02:16 PM
  3. Adding Leading Zeros
    By jo15765 in forum Access
    Replies: 13
    Last Post: 11-20-2010, 11:11 PM
  4. Replies: 6
    Last Post: 04-30-2010, 01:57 PM
  5. leading 'Zeros' in data
    By wasim_sono in forum Forms
    Replies: 3
    Last Post: 04-06-2009, 11:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums