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

    Autopopulate SELECTED existing child records into a New parent record.

    As per my previous thread https://www.accessforums.net/showthread.php?t=71511 the relationship is a one-to-many which I am facing a lot of problems with duplication so I am keeping my options open by changing the same database to many-to-many (cross posted in https://www.access-programmers.co.uk...=299079&page=2. ).


    From the DB attached, in the Create Machine Form there are four cascading listboxes where each depends on previous selection. Now I want to add, say New Machine from the textbox. Items from second, third and forth listbox are automatically populating to the New Machine which I do not want. A user must be able to select and add the items to the new parent (New Machine). I know I need some kind of a code to loop it. With some local help and online tutoring in Access forum me and my partner did it for one to many. Now I do not know how to do it for many to many.
    The last button Create Machine was for one-to-many which I do not know how to tweak for many-to-many.
    A guidance will be greatly appreciated.

    Regards
    Deepak
    Attached Files Attached Files

  2. #2
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 10 Access 2016
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    Sorry not able to look at your attachment but.
    Code:
    In combo 1. You have a number of entries.
    In combo1_CHange you can have code to update the rowsource of combo2. 
    
    Sub Combo1_Change()
    'check if you need to insert data into the rowsource for combo2
    if ineedtoinsert then insertdata
    Combo2.rowsource = values based on combo1.value
    end sub
    
    sub combo2_Change()
    'check if you need to insert data into the rowsource for combo3
    if ineedtoinsert then insertdata
    combo3.rowsource = values based on combo2.value
    end sub
    Do you need to track information in a tree style and enforce it? THink of it like a forum, make a table that tracks
    RowID, ParentID, Description.

    Insert data into this, and reference between the data using a the parent. you can store all the cascade information for the dataset in 1 table. i do this with a tree of data 16 character long .

    Hope this makes sense.

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

Similar Threads

  1. Replies: 15
    Last Post: 05-16-2018, 12:12 PM
  2. Replies: 5
    Last Post: 05-10-2014, 12:25 PM
  3. Parent Child records in reporting
    By Darlene in forum Reports
    Replies: 1
    Last Post: 03-22-2014, 06:49 PM
  4. Replies: 4
    Last Post: 09-13-2013, 05:26 PM
  5. Delete child records with parent record
    By jpkeller55 in forum Access
    Replies: 8
    Last Post: 09-07-2010, 08:52 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