Results 1 to 8 of 8
  1. #1
    emarchant is offline Novice
    Windows 7 Access 2007
    Join Date
    Oct 2010
    Posts
    12

    Need Help Trimming Field!!

    I have a table that the user will copy/paste into the DB. The file they are copy/pasting is given to them by a customer, and format cannot be changed.



    I am trying to create a query that will trim all the blank spaces from a field (VPN) so that I can check that field against our master data. Trim() and RTrim() are still leaving a lot of the blank spaces, causing errors.

    What else can I do?!?!?!?
    Please help!!!

    Thank you!!!

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    trim should get rid of all spaces both in the front and in the rear (not in the middle).

  3. #3
    emarchant is offline Novice
    Windows 7 Access 2007
    Join Date
    Oct 2010
    Posts
    12
    It doesn't work though... I put it in a query as Trim(VPN), and it returns the exact same entries with spaces that I had before!

  4. #4
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    maybe that is not spaces, but some special characters instead?

  5. #5
    emarchant is offline Novice
    Windows 7 Access 2007
    Join Date
    Oct 2010
    Posts
    12
    If that were the case, how would I know and how would I get rid of them??

    Thanks for the help!

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Does you application compile without any errors? Do you have any bogus MISSING references? Something is not right with your system. Try *importing* your db into a fresh, new db and see if the problem follows: http://www.btabdevelopment.com/ts/impnew

  7. #7
    emarchant is offline Novice
    Windows 7 Access 2007
    Join Date
    Oct 2010
    Posts
    12
    This did not work either. I am getting the same result. I am thinking that the characters are some kind of special character... but I don't know how to get rid of them!!!

    Any other ideas??

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Do you have leading "spaces" that will not go away? If so then try using Asc() on the string to see the decimal value of the 1st character. You could then use Replace() to eliminate them.

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

Similar Threads

  1. Replies: 1
    Last Post: 11-13-2010, 12:57 PM
  2. Replies: 3
    Last Post: 11-05-2010, 03:10 PM
  3. Replies: 10
    Last Post: 04-21-2010, 01:16 PM
  4. Replies: 1
    Last Post: 02-26-2009, 11:31 AM
  5. Quick way to stuff field names into text field
    By kfinpgh in forum Programming
    Replies: 0
    Last Post: 01-04-2007, 01:13 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