Results 1 to 3 of 3
  1. #1
    Khalil Handal is offline Competent Performer
    Windows 10 Access 2003
    Join Date
    Jun 2016
    Posts
    242

    Create table from existing junction table

    Hi,
    I am migrating an old database and I have part of the many to many relationship in the new design as in the figure below:
    Click image for larger version. 

Name:	CaptureRelation.PNG 
Views:	8 
Size:	4.3 KB 
ID:	29713

    I already have the records in the junction table and I want to create a new table tblKeyWords with the following fields: pkKeyword and Keywords. How can I do this?
    Data has duplicate values. Below is a data sample
    Click image for larger version. 

Name:	Capture1.PNG 
Views:	8 
Size:	18.3 KB 
ID:	29714



    Khalil

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    pretty straightforward. Before starting, make a backup copy in case things do not go as intended.

    1. Create your new table, ensure that the keyword field is also indexed, no duplicates (which it needs to be, regardless)
    2. copy and paste (or use a query) to insert the keywords in books keywords into the new table (the no duplicates index will do its job and remove duplicates)
    3. add a new field (type number, long) called say KWFK to the bookskeywords table
    4. run an update query to update this field with the PK value from your new table
    5. delete the keywords column from bookskeywords table

    job done

  3. #3
    Khalil Handal is offline Competent Performer
    Windows 10 Access 2003
    Join Date
    Jun 2016
    Posts
    242
    Thank you very much

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

Similar Threads

  1. Replies: 13
    Last Post: 05-10-2017, 12:43 AM
  2. Replies: 5
    Last Post: 08-22-2013, 04:32 PM
  3. Replies: 3
    Last Post: 03-28-2013, 07:22 AM
  4. Replies: 2
    Last Post: 01-28-2013, 08:59 PM
  5. Using VBA create a new table from an existing table
    By KramerJ in forum Programming
    Replies: 0
    Last Post: 03-25-2009, 04:07 PM

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