Results 1 to 10 of 10
  1. #1
    Silvera is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    California
    Posts
    65

    Question Combine FirstName and LastName fields in reports and forms as the full name


    Combine "FirstName" and "LastName" fields as a Full Name in forms and reports. This probably very basic. I've been self-taught and dabbling in Database Programing since Mid '80 and probably have forgotten a lot of what I learned. I have a module where I previously recorded folks by their full name. As the number of folks has grown using 1st and last names will allow better sorting for reports and forms. Any help will be greatly appreciated.

  2. #2
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    [FirstName] & " " & [Surname]

    You can make a calculated field in a table in the expression properties using the above.

    There are other ways of doing it too - you can make a query field do the same thing, however having it in the table already means you do it once only.

    Note: because it is a calculated field you will not have the ability to edit that field on a form.

    Basically you are saying concatenate FirstName field then put a space " " and join it to Surname.

    I tend to name the field TableMergedName so that it doesn't get confusing later.

  3. #3
    Silvera is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    California
    Posts
    65

    Red face Thank you for your prompt response!!!

    Quote Originally Posted by Ruegen View Post
    [FirstName] & " " & [Surname]

    You can make a calculated field in a table in the expression properties using the above.

    There are other ways of doing it too - you can make a query field do the same thing, however having it in the table already means you do it once only.

    Note: because it is a calculated field you will not have the ability to edit that field on a form.

    Basically you are saying concatenate FirstName field then put a space " " and join it to Surname.

    I tend to name the field TableMergedName so that it doesn't get confusing later.
    Thank you for your prompt response!!!

  4. #4
    Silvera is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    California
    Posts
    65

    I'm have problems

    Quote Originally Posted by Ruegen View Post
    [FirstName] & " " & [Surname]

    You can make a calculated field in a table in the expression properties using the above.

    There are other ways of doing it too - you can make a query field do the same thing, however having it in the table already means you do it once only.

    Note: because it is a calculated field you will not have the ability to edit that field on a form.

    Basically you are saying concatenate FirstName field then put a space " " and join it to Surname.

    I tend to name the field TableMergedName so that it doesn't get confusing later.

    -----
    I went into the table, clicked "Click to Add" but the Expression Builder did not open. Is there a trick to getting it to open. I checked MircoSoft's instructions for calculated field and it noted that the Expression Builder would open. I have no clue what I'm doing wrong. I tried using the design view and and got the expression builed open for "Default Value" but it only Functions in the Expression Eliments so that did not work either. How do I get into "in the expression properties" I though I knew something about programing but apparently not enough. I used to use "Clipper" [Don't even know if that is still around] before MS Access came to my attention.

  5. #5
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Design view of the table.

    Then make a new field> calculated. Not text, number etc.

    then in the general options of the design view of the table you will see expression (you can type there if you like)

    right click in that small field (expression)

    build

    then you have an expanded view to build in the expression.

  6. #6
    Silvera is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    California
    Posts
    65
    Quote Originally Posted by Ruegen View Post
    Design view of the table.

    Then make a new field> calculated. Not text, number etc.

    then in the general options of the design view of the table you will see expression (you can type there if you like)

    right click in that small field (expression)

    build

    then you have an expanded view to build in the expression.
    -----
    Thanks, I'll give it a try.

  7. #7
    Silvera is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    California
    Posts
    65
    Quote Originally Posted by Silvera View Post
    -----
    Thanks, I'll give it a try.
    -----
    Well there must be something wrong with my version of Access or my machine has a problem
    I created a new field and these were my only options:
    Text
    Memo
    Number
    Date/Time
    Currency
    AutoNumber
    Yes/No
    OLE Object
    Hyperlink
    Lookup Wizard...

    No listing for a Calculated field.

  8. #8
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    You can apply the described technique to a Query. I don't see a calculated option in Access 2003. Here are some expresion examples I use within querries.

    DriverName: tblDrivers.FirstName & " " & tblDrivers.LastName

    CityState: tblAddr.City & ", " & tblAddr.State & " " & tblAddr.Zip

    Truck: "#" & tblEquip.EquipNum & "-" & tblEquip.EquipYear & " " & tblEquip.EquipMake

    The difference with the query is you will place the code in a new field, in the field row in the lower part of the window within design view. Don't bother with the pulldown in the field area. You can right click and zoom too, if that helps.

    I will break down the Driver Name expresion here

    DriverName: tblDrivers.FirstName & " " & tblDrivers.LastName
    NewFieldName: YourTableName.FieldName & " Add some Text here " & YourTableName.AnotherFieldName

  9. #9
    Silvera is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    California
    Posts
    65
    Quote Originally Posted by ItsMe View Post
    You can apply the described technique to a Query. I don't see a calculated option in Access 2003. Here are some expresion examples I use within querries.

    DriverName: tblDrivers.FirstName & " " & tblDrivers.LastName

    CityState: tblAddr.City & ", " & tblAddr.State & " " & tblAddr.Zip

    Truck: "#" & tblEquip.EquipNum & "-" & tblEquip.EquipYear & " " & tblEquip.EquipMake

    The difference with the query is you will place the code in a new field, in the field row in the lower part of the window within design view. Don't bother with the pulldown in the field area. You can right click and zoom too, if that helps.

    I will break down the Driver Name expresion here

    DriverName: tblDrivers.FirstName & " " & tblDrivers.LastName
    NewFieldName: YourTableName.FieldName & " Add some Text here " & YourTableName.AnotherFieldName
    ------
    2010 version they added the calculation option to the field types. I just can't get it to work as the instructions say it should.

  10. #10
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    I don't have any experience with that and it is good information to know. I can tell you that if you place the code I offered into a query and type the correct table and field names it will work. All you have to do is (edited for clarity) find your "NewFieldName" in the query or on a form. Test your query by running/viewing it and post your results with the expression you created.

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

Similar Threads

  1. Replies: 7
    Last Post: 07-11-2013, 10:27 AM
  2. Full Name from FirstName LastName
    By jhrBanker in forum Forms
    Replies: 14
    Last Post: 06-23-2013, 03:12 PM
  3. Replies: 8
    Last Post: 05-08-2012, 03:20 PM
  4. FirstName + LastName
    By mehulkar in forum Access
    Replies: 1
    Last Post: 07-28-2011, 01:40 PM
  5. Concatenate firstname + lastname
    By Dega in forum Access
    Replies: 2
    Last Post: 08-11-2010, 04:58 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