Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2009
    Location
    Pimpsville, USA
    Posts
    3

    Red face Leading Zeroes


    Question- I am trying to keep my leading zeroes in Access. I change the format of my AutoID in design view to "0000000" so that 1,2,3...etc would be displayed as 0000001,0000002,0000003...etc.

    However, I need to combine this with another field and when I do that, the zeroes drop. I understand that the physical data is numeric, and I have tried simply changing it from AutoID data type to Text - but still no luck.

    I am currently getting around the problem by copying the data in Excel, then copying it in to Notepad, then re-importing the file back into Access and changing the data type from Long Integer to Text in the Import Wizard.

    Any way to solve this in Access alone?

    Thanks

  2. #2
    thhui is offline Competent Performer
    Windows XP Access 2002 (version 10.0)
    Join Date
    Feb 2009
    Posts
    235
    Try this:-

    Code:
    You can concatenate [AutoID] with [otherVar] this way:-
    format([AutoID], "0000000") & [otherVar]

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Is the AutoID field an AutoNumber field? Do you know that there is no guarantee the numbers are sequential? Have you read this link? General: Use Autonumbers properly

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

Similar Threads

  1. 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