Results 1 to 3 of 3
  1. #1
    cotri is offline Advanced Beginner
    Windows XP Access 2000
    Join Date
    Jan 2010
    Posts
    32

    Combining fields

    I have used just one field for customer’s names for years now but now I am importing records where the names are in two fields, first and last. I can use [FirstName] &” “&[LastName] in the “Control Source” for the [FullName] field but then I am no longer able to continue entering full names in the [FullName] field. Is there anyway to input this data both ways? Thanks

  2. #2
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows XP Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    cotri

    Having two fields is the correct method.

    But then there is the case of entering data vs viewing Data.

    When you enter Data on a Form you should have the two separate fields.

    But in a report you would concatenate the two fields as you have correctly described.

    The separate Fields is better for filtering and for sorting.

    e.g What if you wanted all those people whose last name was Smith. Two fields make this possible but a combined field makes this very difficult.

  3. #3
    ConneXionLost's Avatar
    ConneXionLost is offline Simulacrum
    Windows XP Access 2003
    Join Date
    Jan 2010
    Location
    Victoria, Canada
    Posts
    291
    Hi cotri,

    As you have identified, it is easy to merge together (concatenate) separate fields using the "&" character to make one text string. However, going in the other direction is a little more difficult. You will need to use String Manipulation Functions. First you'll need to find the space character in the text string using the InStr function. Then you'll need to use the Left, Right, or Mid functions to cut out the appropriate pieces of the text string for your first and last names. Sadly, this whole process will fall apart on the occasion when a compound first (Billy Bob) or last (Van Horne) name occurs.

    Another issue will take place when you try to "input this data both ways". Formulas don't like working in reverse, so you won't be able to use them to fill in one field based on another. This will have to be done with a fairly lengthy VBA script.

    It really comes down to the question, "Are you sure you don't want to use two fields?"

    Cheers,

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

Similar Threads

  1. Combining Two Queries
    By csolomon in forum Queries
    Replies: 1
    Last Post: 09-03-2009, 01:33 PM
  2. combining fields into a single list
    By rich in forum Queries
    Replies: 4
    Last Post: 02-23-2009, 06:41 AM
  3. Help me please w/ combining like customers
    By lsulaurie in forum Queries
    Replies: 2
    Last Post: 06-30-2008, 02:59 PM
  4. Replies: 1
    Last Post: 06-03-2006, 05:02 PM
  5. Combining Databases
    By RHall in forum Access
    Replies: 2
    Last Post: 04-13-2006, 07:36 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