Results 1 to 2 of 2
  1. #1
    rasticle is offline Novice
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    2

    Unhappy Importing and mapping data to various tables


    Hi,

    This is probably easier than I'm making this out to be. If I have a data table that is denormalized and I want to import the data into a normalized database what steps do I take? What I have is very simple I have a table with facility and contact information. I want to seperate the data into existing facility and contact tables. Because there can be many facilities for one contact some contact information is repeated. How do I append that data and keep the information linked(ei keep the correct contact with the correct facility)?

    I think my head is about to explode! I haven't worked with access for 2 years and now im being tasked to work with it again. =(

    Thanks!

  2. #2
    Robertt is offline Novice
    Windows 7 Access 2007
    Join Date
    May 2010
    Posts
    12
    rasticle,

    This is typically done in module using a loop of some kind and I will assume you are using Access' autonumber.

    While in the loop, you create your own unique key and assign it to a non important field in the parent record you are creating. I.e., you might have a notes column and you assign it a value of facilityname_dummyid. After inserting the record, you can then go back and search your notes column for the value you just assigned, and then grab the real primary key. Now that you have the real primary key, you can use it for your child tables.

    I.e.,
    Code:
     
    do while loop through denormalized data one record at a time
    
    insert into tblFacilities (fldNotes, my column list) select "facilityName_dummyid",my value list from my_denormalized_data where row=XXX select fldpk from tblFacilities where fldNotes= "facilityName_dummyid" update tblFacilities set fldNotes="" where fldNotes="facilityName=dummyid" insert into tblChildRecords (foreignkey, my column list) select rsFacilities.pk, my value list from my_denormalized_data source
    wend
    HTH,

    Robert

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

Similar Threads

  1. Importing Data with Outlook
    By Stanggirlie in forum Import/Export Data
    Replies: 1
    Last Post: 07-15-2011, 08:50 AM
  2. Importing data and data quality
    By fsmikwen in forum Import/Export Data
    Replies: 1
    Last Post: 02-01-2010, 03:15 PM
  3. importing data- find new data
    By cengineer in forum Import/Export Data
    Replies: 1
    Last Post: 12-10-2009, 08:56 AM
  4. mapping problem?
    By stevenyp in forum Programming
    Replies: 2
    Last Post: 10-08-2009, 10:13 AM
  5. form - subform field mapping
    By nqirar in forum Programming
    Replies: 2
    Last Post: 03-02-2009, 01:49 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