Results 1 to 4 of 4
  1. #1
    masond is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    12

    making all numbers certain size

    Hey guys



    Hope all is well

    Sorry to bother you with such a basic question, but I need some help

    Every month, I receive an excel file.

    Within the excel file, column A, is populated full of numbers. These numbers varies in length

    For eg
    000001
    100002
    1111110
    5234000
    29788881
    31111111

    Steps
    1)What I want to do is import this file into access

    2) if there are only 6 digits, add additional zeros on front of the number, so that max number of digits is 10
    For eg using the sample data above

    100002 is 6 digits long I want it to display as 000 0 100 002
    1111110 is 7 digits long I want it to display as 000 1 111 110
    5234000 is 7 digits long I want it to display as 000 5 234 000
    29788881is 8 digits long I want it to display as 002 9 788 881

    From this, I would like to do a right look up (preferably look up 7), to produce a standard length number
    0100002
    1111110
    5234000
    9788881

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    Let x represent the field.

    Consider:

    Format(x, "000 0 000 000")

    Mid(Format(x, "00000000"), 2)
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    masond is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    12
    hi june,
    do you have an example you can post up ?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    Use those expressions in query, textbox ControlSource, or code (macro or VBA). Replace x with the actual field name.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Just making sure I'm on the right track
    By XianSPL in forum General Chat
    Replies: 2
    Last Post: 11-15-2012, 01:46 PM
  2. Replies: 3
    Last Post: 07-19-2012, 09:27 AM
  3. Replies: 1
    Last Post: 11-29-2011, 08:43 AM
  4. Making an equation
    By joce in forum Access
    Replies: 1
    Last Post: 10-27-2011, 09:56 AM
  5. Help making 1 to 1 relationship
    By Rhino373 in forum Programming
    Replies: 2
    Last Post: 06-15-2011, 02:51 PM

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