Results 1 to 8 of 8
  1. #1
    kwooten is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    255

    Table issue with text format


    I have a table that is imported to Access with a 5 digit identifier code but the leading zero is dropped but access still counts the dropped zero as a value so 01234 looks like _1234. I am linking to a table that has the leading zero removed making it a 4 digit code for any number with a leading 0 and a 5 digit code for any number without the leading zero. what can i do to get these fields to match? The imported file cannot be fixed to include a leading zero.

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    I have a table that is imported to Access with a 5 digit identifier code but the leading zero is dropped but access still counts the dropped zero as a value so 01234 looks like _1234
    I have never heard of such a thing.
    What is the data type of the field in the Access table?
    Is there any special formatting on it?
    How are you importing that file?

    Note that in order to link any two fields together in Access, they will need to be the same data type (in this case, either both Text or both Numbers).

  3. #3
    kwooten is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    255
    both fields are text fields in Access. There isnt any special formatting that i am aware of. The file is imported through a program called Monarch. It may be that the file within Monarch is pulling 5 digits but the report may have some instances of 4 digits and the export is picking up that blank field so it puts a space before the 4 digit number...

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    I agree with Joe, haven't heard of this action. Where did this data get imported from?
    Can you show us somw sample from the original file?

  5. #5
    kwooten is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    255
    yeah i will see if i can get a sample together

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    I've never heard of Monarch, but found this via Google
    http://excelwithmonarch.com/tips/mon...gramming-class

  7. #7
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Yes, if it is a Text field, Access would not be dropping the leading zero. It is getting dropped before then.

    In order to compare the two files, you will need to add the missing leading zero in. There are a few ways of doing that:
    1. Updating the Access table after import (using an Update Query)
    2. Adding the leading zero in via a calculated field in a Query, and link this query to your other table

    If doing option 1, create a query that select all ID fields where the length is 4. Then update it like this (in the Update To row):
    Code:
    "0" & [IDField]
    If doing option 2, use a calculated field like this:
    Code:
    RealID: IIf(Len([IDField])=4,"0","") & [IDField]

  8. #8
    kwooten is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    255
    thanks Joe.. ill give that a try

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

Similar Threads

  1. Format Issue
    By jbailey4545 in forum Queries
    Replies: 1
    Last Post: 11-13-2013, 02:00 PM
  2. Number format issue
    By stafjoy in forum Queries
    Replies: 5
    Last Post: 07-19-2012, 08:38 AM
  3. Code issue on Format of label
    By Gavroche in forum Reports
    Replies: 2
    Last Post: 09-14-2011, 06:19 AM
  4. Date format issue
    By di.miller in forum Queries
    Replies: 3
    Last Post: 03-17-2011, 09:36 AM
  5. Format Issue
    By trueblue7 in forum Reports
    Replies: 4
    Last Post: 12-04-2010, 10:50 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