Results 1 to 6 of 6
  1. #1
    halnurse is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2016
    Posts
    22

    Autofill records in child records from parent form

    I have a form used to create purchase orders. In the parent form there is a field that is automatically generated as it is the ID field from a tblPO. I also have a drop down to select the customer, coming from a .


    I have a subform that is used to write what material is being purchased for the specific customer. Is there a way for the Purchase Order number and the customer to auto populate into each record in the subform after selecting them is the parent form?? I am also trying to use a datasheet for the child form if that makes a difference.
    Thanks in advance for your time.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    run an append query. Set the masterkey to be appended from the master form, and all records from their table,

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    Master/Child links of subform container will automatically save the parent form primary key into dependent record as a foreign key. This establishes a relationship link between the parent and child records. It is not necessary to have the PO number and customer info in the subform record.
    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.

  4. #4
    halnurse is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2016
    Posts
    22
    Thanks for your reply. So right now when I enter data into the subform, only the first record has the PO number and the customer saved and then subsequent records are left blank. Is there a way to fix this?

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    Wait, I might have misunderstood table relationships. We need to know more about your data structure and relationships.

    You have a table for PurchaseOrders which are received from customer? Then there is a dependent table for the materials required to fulfill that order?

    Perhaps main form bound to PurchaseOrders and a subform bound to PurchaseOrderMaterials with a combobox in subform for selecting material. Master/Child links properties of subform container will automatically save PurchasedOrder ID to dependent record.
    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.

  6. #6
    halnurse is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2016
    Posts
    22
    I figured it out, I had an unnecessary relationship between tables. Thanks for all your help

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: 3
    Last Post: 04-06-2016, 12:49 AM
  3. Replies: 5
    Last Post: 05-04-2015, 02:02 PM
  4. Parent Child records in reporting
    By Darlene in forum Reports
    Replies: 1
    Last Post: 03-22-2014, 06:49 PM
  5. Delete child records with parent record
    By jpkeller55 in forum Access
    Replies: 8
    Last Post: 09-07-2010, 08:52 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