Results 1 to 5 of 5
  1. #1
    kawi6rr is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    39

    How to split an excel sheet with all data into a one-to-many relationship?

    I’m trying to create a database to track melanomas. I need to split the excel sheet into a one-to-many relationship because one member can have multiple melanomas.



    Tables
    memberInfo ß---- one-to-many ------à melenama

    meberInfo structure
    Code:
    Name Type Size
    id Long Integer4
    MRN Long Integer4
    Last Text 50
    First Text 50
    MI Text 50
    Sex Text 50
    DOB Date/Time 8
    
    Melanoma structure
    Code:
    Name Type Size
    melanomaID Long Integer 4
    MRN Long Integer 4
    ProvLast Text 255
    Prov FirstText 255
    ProvMI Text 255
    Degree Text 255
    PCP FirstText 255
    PCPLast Text 255
    PCPClinic Text 255
    LastSeen Text2 55
    


    I have multiple excel sheets that I need to import but haven’t been able to figure out how to get these split and yet keep referential integrity.

    Any help is appreciated, thanks!

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    Which field is the common (key) field that cross references between the 2 tables?

  3. #3
    kawi6rr is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    39
    The MRN number can be a unique identifier but I usually let Access supply the ID. But looking at those tables in the attempt it looks like I was using the MRN number at the ID.

  4. #4
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    Your design looks correct. Use the MRN as the cross referencing field. You can still add the primary key from Access field too - to each table. The MRN does not have to be the primary key - but it is important in the Member table that the MRN never repeats.

    As your post is emphasizing "split the excel sheet" - I am guessing all this info exists in 1 excel sheet today - meaning that a member with multiple melanoma has multiple record entries.

    Import the whole excel sheet into a table - name it Member. Then duplicate the table - name it Melanoma. Then delete all the inappropriate columns off each respectively. Finally you want the Member table to contain only 1 record per member - if the volume is not onerous then just sort on member name and manually delete duplicates; otherwise if the volume is high you will need to create a one time action query to do this.

    Then go to Relationships and draw a relationship from Member MRN table to Melanoma MRN table.

    Hope this helps.

  5. #5
    kawi6rr is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    39
    This worked, Thanks!!

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

Similar Threads

  1. Import Excel sheet with query
    By tpcervelo in forum Queries
    Replies: 1
    Last Post: 08-03-2010, 07:10 PM
  2. Importing full excel sheet to access
    By karakal in forum Import/Export Data
    Replies: 0
    Last Post: 03-22-2010, 03:48 PM
  3. Replies: 0
    Last Post: 02-21-2008, 09:52 AM
  4. Importing Excel Sheet into Access dbase
    By tonystowe in forum Import/Export Data
    Replies: 0
    Last Post: 12-08-2006, 11:35 AM
  5. problem setting Excel sheet name in vba from a form
    By dataman in forum Programming
    Replies: 2
    Last Post: 04-18-2006, 07:26 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