Results 1 to 6 of 6
  1. #1
    mainsupt is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    3

    Help with fields and Query's

    I have imported an Excel Spread sheet with a column called "Full Name". In Access the field shows those Full Name's like: Tommy J. Smith. There could be a Tom J. Smith or a Tom Smith or a Tommy Smith in the data as well as Tommy J. Smith. I would like to break the names apart and end up with a Last Name and First Name field. Can you help?



    Also I built a simple Query joining two tables. The common field is the Primary Key. There are four fields Primary Key, Full Name and from the other Table Last Name and Primary Key. When I sort the Query it sorts by Primary Key. What am I doing wrong.

    Thanks for any help.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    1) You could walk through the Recordset and use the Split() function to separate the values.
    2) Two tables should not have the same PrimaryKey, unless you meant the 1st table's PK was in the 2nd table as a ForeignKey.

  3. #3
    mainsupt is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    3
    I'm lost. I don't know how to write VB and I think thats what your suggesting in #1. Is there some other way to separate the date?

    The two tables each have a Primary Key which is ID. Not sure what a Foreign Key is.

    Sorry & thanks for the help.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    There is no built in function that will separate the FullName field for you. Yes, it will take code.
    As for the PrimaryKeys, are you saying these two tables have the same PrimaryKeys?

  5. #5
    mainsupt is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    3
    Anywhere you can point me to that has code that I can copy or learn how to enter?

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    Splitting apart a FullName is not trivial:
    Bill Smith
    Bill Smith Jr.
    Bill J. Smith
    All you know for sure is his first name is probably Bill!
    How about answering my question on PK's.

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

Similar Threads

  1. Combine two fields, Null fields involved
    By yes sir in forum Access
    Replies: 9
    Last Post: 10-03-2010, 09:20 AM
  2. Replies: 5
    Last Post: 03-20-2010, 08:30 AM
  3. Replies: 3
    Last Post: 08-10-2009, 08:33 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