Results 1 to 6 of 6
  1. #1
    rtcary is offline Advanced Beginner
    Windows XP Access 2002 (version 10.0)
    Join Date
    May 2010
    Posts
    35

    How to concatenate DB fields with punctuation

    I want to have some fields in a Report concatenate some fields e.g. "Last name, First name". I am using Access 2010 (my experience is with Access XP). Which Design object do I use and how do I specify the data fields?

    My table is Members and the field names are "First name" and "Last name".

    With appreciation...

    Todd

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    FYI, should not use spaces in object names (field names, form names, query names,...)

    However, in a column in a query use:

    Code:
    FullName: [Last Name] & ", " & [First Name]

    In the report, a text box control would be bound to "FullName"

  3. #3
    rtcary is offline Advanced Beginner
    Windows XP Access 2002 (version 10.0)
    Join Date
    May 2010
    Posts
    35
    Thank you for the reminder about spaces; that will definitely be corrected once I get use to the "new" Access2010 and the "ribbon". Can I place a concatenated data object on the free form Report without creating the field in the query...just use references to a Table's fields?

    Thank you,

    Todd

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    If the Fields are included in the RecordSource for the Report you can simply create an Unbound Control on the Report and use this in its Control Source Property:

    =[Last Name] & ", " & [First Name]

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    AS Linq said, you can certainly use an unbound calculated control on a report; I use them a lot in headers and/or footers.
    But if the calculated control is in the detail section, I have found it much easier to do the calculation (concatenation) in the query.

  6. #6
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by ssanfu View Post

    ...I have found it much easier to do the calculation (concatenation) in the query.
    Most things are!

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Fields Concatenate insted of Add
    By modum in forum Queries
    Replies: 3
    Last Post: 02-12-2014, 04:17 PM
  2. Concatenate two fields
    By buckwheat in forum Access
    Replies: 8
    Last Post: 06-28-2013, 07:06 AM
  3. Concatenate Fields
    By Njliven in forum Forms
    Replies: 9
    Last Post: 12-21-2012, 08:31 AM
  4. Merge fields (not concatenate)
    By sberti in forum Access
    Replies: 2
    Last Post: 11-30-2012, 12:53 AM
  5. Creating Query from Code, Concatenate fields
    By eww in forum Programming
    Replies: 5
    Last Post: 07-18-2011, 02:19 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