Results 1 to 7 of 7
  1. #1
    drunkenneo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    199

    Breaking Up table in FK and PK

    I have a situation where i need to import a table in Access which is in Excel, After importing i need to know how can i break it up differently keeping relation of FK and PK intact: For Eg


    Excel Sheet:

    Name Biz ID Biz Name Address1 Address 2 Address 3 OrderNo Order Date


    Person Record
    ID(PK) Name Biz ID Biz Name Address 1 ....

    Order Record
    OrdIDPK ID FK OrderNo Order Date

    How can i distribute it?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Could use BizID as the PK/FK.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870

  4. #4
    drunkenneo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    199
    My main challenge is to separate the table content to different tqbles keeping the relation ship intact

  5. #5
    drunkenneo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    199
    Quote Originally Posted by June7 View Post
    Could use BizID as the PK/FK.
    It gave a thought, i will do it, but main challenge is pretty different, to separate the content of the table with reference remain intact

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Actually, by using the BizID as PK/FK, it can be easy, assuming there are no errors in spelling of business names and the address info is exactly the same for all instances of the same business. However, those are dangerous assumptions. Any variance will complicate.

    Make a copy of the table, rename it Orders, delete the BizName and Address fields.

    Do a query that will select unique BizID, BizName, Address1, Address2, Address3 records and create a new table called Persons.

    The original table can be eliminated.

    Additional steps will be required if you want to make an autonumber field the PK/FK.


    Or create a link to the Excel worksheet and run the Analyze Table utility. http://support.microsoft.com/kb/292799
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    drunkenneo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    199
    Thanks June it was a help

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

Similar Threads

  1. Replies: 5
    Last Post: 03-25-2012, 09:38 AM
  2. Replies: 1
    Last Post: 01-26-2012, 03:58 PM
  3. Replies: 1
    Last Post: 11-18-2011, 01:59 PM
  4. Breaking the string into Text / Number
    By Amerigo in forum Queries
    Replies: 15
    Last Post: 05-20-2011, 03:29 PM
  5. Replies: 6
    Last Post: 02-08-2011, 09:22 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