Results 1 to 7 of 7
  1. #1
    Keekee is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2020
    Posts
    3

    Linking Imported Table to Table already in Database

    First I just want to say that I have been working in Access for a while, but not good with the VBA code part. With that being said, I have tried several ways to connect an imported table (imported from excel) to the Main table without any luck.

    My Current database has a many to many relationship. One main table is "Personnel". One main table is "Projects". The junction table is "Details".

    My Main form is the "Projects" form with the subform being "Details". In the details subform I have an "Employee" field as a lookup to the "Personnel" table.



    The data I import is hours worked for each person and each project. After I import it I call that table "Actuals".

    I can't figure out how to link the Actuals table to any other table. The only common field is "Employee", but I get a data mismatch since I am using the Personnel.Employee as a lookup.

    I thought about adding a the Personnel foreign key to the actuals table, but could not figure out how to populate that field for each record in that table. Is this even doable?

    What is the best way to link the imported table of actuals so I can get how hours each person worked for each project?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    So Employee field in Actuals has what data - employee name? Names are very poor unique identifiers.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    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
    Keekee is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2020
    Posts
    3
    Yes, employee name. That is the only unique identifier in the imported table unless I could add a field and assign it the EmployeeID from the Employee table so I could link the two, but I don't know how to do that other then manually. Do you know if that is a possibility? I will look at your link. Thanks.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Yes, build query that joins Actuals to Personnel on name. Switch to UPDATE. Set field in Actuals to update to personnel ID field.
    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.

  5. #5
    Keekee is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2020
    Posts
    3
    I can't join Actuals to Personnel on name because the junction table is using the name in the Personnel table as a lookup, therefore the there ends up being a data mismatch when I try to join Actions to Personnel with name. Any other ways to do it? I was just thinking about copying the Personnel list and Primary Key into the Excel sheet on a different worksheet and doing a lookup and having he Personnel Key populate the table before I import it. But I would have to do that every time as the both tables grow.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Sorry, but that does not make sense. Personnel table should have at least one field for person name. And if Actuals has person names, joining on the two should be simple.

    You need to provide data for analysis.
    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
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    Show us your table relationships (relationship window)--extend all tables so readers can see all fields.
    As June suggested, a copy of your database for review would be helpful --only enough records to show your requirements in context.

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

Similar Threads

  1. Replies: 4
    Last Post: 11-27-2014, 10:20 AM
  2. Replies: 1
    Last Post: 06-11-2014, 11:38 AM
  3. Replies: 3
    Last Post: 03-06-2013, 04:53 PM
  4. linking table in a password protected database
    By bdaniel in forum Programming
    Replies: 1
    Last Post: 01-04-2012, 01:25 AM
  5. Linking Access Table with already imported External Data (Excel)
    By izzarshah in forum Import/Export Data
    Replies: 1
    Last Post: 07-29-2010, 09:40 AM

Tags for this Thread

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