Results 1 to 12 of 12
  1. #1
    jamesfranklin is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    33

    Tab space

    Hi,
    I'm having a table Which Contain column address. sometimes I Entered full address in single column
    like this
    Wrong Format

    American Samoa Community College
    PO Box 2609


    Pago Pago 96799


    Correct Format
    American Samoa Community College PO Box 2609 Pago Pago 96799



    using query or vba i want to display the wrong format. anyone help please..





    Thank u for ur valuable time spending in this post

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,943
    Data should be in 4 columns not 1.
    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
    jamesfranklin is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    33
    Hi June7,
    Thank u for ur reply. I attached file please go through the file n give me some solution. I met so much of problem by this type of data


    Thank u. for spending time in this post

    Attached Files Attached Files

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,943
    Redesign the table with 5 fields:

    Company AddressStreet City State Zip
    University of California 1111 Franklin St. Oakland CA 94607
    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.

  5. #5
    jamesfranklin is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    33
    Hi june7,
    Thank u for reply.

    How to redesign this data

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,943
    Open table in design view, create the fields, enter data.

    Do you already have a lot of records in your db?

    Depending on structure of the address string, might need VBA code to automate moving data from the one column to multiple columns and consistency in structure would be critical to this approach.
    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.

  7. #7
    jamesfranklin is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    33
    Hi june7,
    Thank u....for ur reply. Already my table having different fields
    Like this...


    Company AddressStreet City State Zip
    University of California 1111 Franklin St. Oakland CA 94607


    What my problem is directly Copy data from the website and paste into the field. Sometimes i
    Cut, Copy, Paste. Sometimes i forget to Cut. Is Pasted like this...


    Company AddressStreet City State Zip
    University of California
    1111 Franklin St.
    Oakland CA 94607
    1111 Franklin St. Oakland CA 94607



    Thnak u........

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,943
    So what you really want to do is edit the Company field for those records you forgot to cut.

    If there is a CrLf code at the end of each line, that code could be used to extract the company name part and update the field. The extraction code could be something like:

    Left([Company], InStr([Company], Chr(13))-2)
    Last edited by June7; 11-16-2012 at 11:28 PM.
    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.

  9. #9
    jamesfranklin is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    33
    Thank U for ur reply june7.
    What's mean by
    CrLf code and what will happen by using this CrLf code?

    Some Example??????Please

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,943
    CrLf means 'carriage return line feed'.

    Chr(13) = carriage return
    Chr(10) = line feed
    Chr(13) & Chr(10) = carriage return and line feed

    In VBA code, vbCr, vbLf, vbCrLf are constants that represent the above.

    Use the expression in a query and the result should be an extraction of the company name. You can use that expression as the value to update the field to remove the extra lines. Unfortunately the expression will error if Chr(13) is not found. So limit the update to only those records that contain Chr(13). Create a field in query with calculation:
    InStr([Company],Chr(13))

    Then use criteria under that constructed field: >0

    Be sure to make a copy of the table for testing before doing actual data update.

    EDIT: This expression will not error even if Chr(13) is not in the value. No need to filter the records.
    Left([Company],IIf(InStr([Company],Chr(13))>0,InStr([Company],Chr(13))-2,Len([Company])))
    Last edited by June7; 11-16-2012 at 11:26 PM. Reason: NEW IDEA
    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.

  11. #11
    jamesfranklin is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    33
    Hi june7,
    Thank You for Your reply. 50% Work Done Still trying

    Thank you..

    Regards
    Jamess

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,943
    The last suggestion worked - issue resolved?
    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. space between Detail and Footer
    By ConfusedMike in forum Reports
    Replies: 5
    Last Post: 11-17-2015, 05:46 PM
  2. Replacing space with dot
    By JeroenMioch in forum Programming
    Replies: 15
    Last Post: 10-22-2012, 07:09 AM
  3. Remove White Space
    By jsimard in forum Reports
    Replies: 3
    Last Post: 01-24-2012, 12:16 PM
  4. Space between two text boxes
    By ashbear in forum Reports
    Replies: 3
    Last Post: 08-17-2011, 05:02 PM
  5. Getting Rid of Empty Space
    By Pam Buckner in forum Database Design
    Replies: 5
    Last Post: 03-05-2010, 05:46 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