Results 1 to 9 of 9
  1. #1
    buckwheat is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2013
    Posts
    144

    Concatenate two fields


    I concatenated two fields in a query for a cbo, one field has cpt# the other descriptions. CPT# can vary with respect to maybe a four digit, five digit, etc. Because of this, when joining these fields, descriptions are not lined up. Is it possible to fix this?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Check out the Space() function (use with Len).
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    buckwheat is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2013
    Posts
    144
    Can you be a little more specific please . . . where does this get entered?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Within your concatenation, to add the appropriate number of spaces between the fields.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    buckwheat is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2013
    Posts
    144
    thanks Paul, I initially tried it there and thought I was doing something wrong, it returns the same results as using &" "&. It's a small issue, so I won't worry about resolving it.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    What exactly did you try?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    buckwheat is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2013
    Posts
    144
    I tried inserting Space(6), since I wasn't sure how else to put it. Doesn't matter though, I've moved on to the next phase. Thanks for your advice

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    More like

    Space(6 - Len([cpt#]))
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    buckwheat is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2013
    Posts
    144
    thanks again

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

Similar Threads

  1. Replies: 5
    Last Post: 03-11-2013, 03:12 PM
  2. Concatenate Fields
    By Njliven in forum Forms
    Replies: 9
    Last Post: 12-21-2012, 08:31 AM
  3. Merge fields (not concatenate)
    By sberti in forum Access
    Replies: 2
    Last Post: 11-30-2012, 12:53 AM
  4. Creating Query from Code, Concatenate fields
    By eww in forum Programming
    Replies: 5
    Last Post: 07-18-2011, 02:19 PM
  5. Concatenate two fields (text & number) for key field
    By Larry Elfenbein in forum Forms
    Replies: 2
    Last Post: 11-10-2005, 07:45 AM

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