Results 1 to 7 of 7
  1. #1
    rbolton is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    3

    Trim space between fields


    We would like to be able to trim the space between fields in Access.

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Not sure you mean. There really aren't spaces between "fields".
    Do you mean trim spaces between words within a single field in Access?
    Or perhaps you are doing an export of the data?
    A simple example may help illustrate exactly what you are after.

  3. #3
    rbolton is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    3
    I didn't explain my question as well as I should have.
    When you print a form that has two adjacent fields, and the text in the first of the two fields is shorter than the field and you want the second field to print one space to the right of the first field, how do you tirm the space that is the extra space in the first field?

    Thank you.

    example: Bill Smith
    (first field) ( second field)
    trim this
    space

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Have you tried concentenating your fields into a single variable?

    For instance let's say you have a field FirstName and a field LastName where you want one space between first and last name you'd have a single text box with the formula

    =[FirstName} & " " & [LastName]

  5. #5
    send2steph is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    6
    Quote Originally Posted by rpeare View Post
    =[FirstName} & " " & [LastName]
    Save your form as a report, then slightly change the report so that the fields are concatenated as suggested.
    Fill in the form; print the report.

  6. #6
    rbolton is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    3
    I'm new to Access and don't know how to concentenate. I have never used that word in my vocabulary. Can you concentenate in forms? Do you have to copy the form into a report? Then, do you go back to a form to print?
    I really appreciate the assistance.
    Ross Bolton
    I'm trying to eliminate the spaces in a field when printing to fields where the text does not use all the spaces and I would like the two texts to print with a single space between them. The example is a first and last name.

    Thanks again.

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,961
    Assuming field names LastName, FirstName - an expression in textbox Control Source property or in a query would be like:

    [LastName] & ", " & [FirstName]

    The & character is preferred concatenation operator. However, be careful as the + character will also do concatenation in some cases.
    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. Trim!
    By redbull in forum Programming
    Replies: 9
    Last Post: 11-06-2012, 06:01 AM
  2. Trim vba
    By shexe in forum Access
    Replies: 5
    Last Post: 11-16-2011, 10:20 AM
  3. Adding a space between fields with hyperlink
    By JeffG3209 in forum Programming
    Replies: 5
    Last Post: 05-04-2011, 08:35 AM
  4. Trim value
    By dada in forum Programming
    Replies: 5
    Last Post: 09-02-2010, 11:01 PM
  5. Trim
    By JMantei in forum Forms
    Replies: 1
    Last Post: 06-20-2006, 02:06 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