Results 1 to 7 of 7
  1. #1
    Deepak.Doddagoudar is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Mar 2018
    Location
    Sweden
    Posts
    43

    Auto Populate new record in Junction Table.

    Hello all,
    I am having a many to many relationship between table tblMachine, tblMachineSystem, tblMachineSubSystem and tblComponents. I have created junction tables between tblMachine and tblMachineSystem, tblMachineSystem and tblMachineSubSystem and tblMachineSubSystem and tblComponents. I have a multiple Multiselect listboxes in the form. The new record from the form textbox must populate the tblMachine and its ID must populate the junction table a shown below. Now how to write a code (I do not want to go to subforms) for this. In the table, MachineID 2 is the new record.
    MachineID MachineSystemID
    1 1
    1 2
    2 1
    2 2




  2. #2
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Sorry, I am confused about what you are trying to do. I understand you are looking for code to add records to a junction table.
    But I am not sure where the data is coming from. You say "junction tables" and "multiple Multiselect listboxes" and textbox..... very confusing.


    Could you provide an image of the relationship window and form(s) or the dB.
    Or explain again using table names, field names, show data and expected results??

  3. #3
    Deepak.Doddagoudar is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Mar 2018
    Location
    Sweden
    Posts
    43
    Click image for larger version. 

Name:	Form.PNG 
Views:	20 
Size:	22.3 KB 
ID:	33351
    You can see from the form there are four listboxes- Machine, Machine System, Machine Sub System and Components. And a button to for each selection. There is also a text box New Machine on the top right. The data for Drilling Machine is already available in the tables. Now i want to add a new machine to the listbox Machine via text box and link existing items from Machine System, Machine Sub System and Components.
    In the beginning when i create the New Machine it is populating to the tables but I want to populate it to the junction table as i showed in the previous message.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726

  5. #5
    Deepak.Doddagoudar is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Mar 2018
    Location
    Sweden
    Posts
    43
    Yeah it is my post. I am keeping my options open and posting it in multiple forums to get a quick suitable answer.

  6. #6
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    That's fine ...but you should always state you are cross posting and provide the link in EACH forum.
    Otherwise you will irritate forum members and get fewer answers ...not more
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  7. #7
    Deepak.Doddagoudar is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Mar 2018
    Location
    Sweden
    Posts
    43
    Oh.. Okay. I apologize as I did not know about this as I am just two months old in Access.

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

Similar Threads

  1. Replies: 3
    Last Post: 02-29-2016, 03:26 PM
  2. Replies: 1
    Last Post: 06-24-2014, 01:31 PM
  3. Populate Junction Table related to 3 Tables
    By Daoud1987 in forum Access
    Replies: 5
    Last Post: 12-11-2013, 12:13 PM
  4. Using form to add record to Junction table
    By SaskiFX in forum Forms
    Replies: 5
    Last Post: 03-19-2013, 12:16 PM
  5. How to use Junction Table to populate DB
    By Sorbz62 in forum Forms
    Replies: 1
    Last Post: 10-02-2011, 05:45 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