Results 1 to 4 of 4
  1. #1
    naungsai is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2022
    Posts
    1

    Populate dynamic list into sub-form

    Dear folks
    I have a 2 table; first has GroupID, GroupName, second had ItemID, GroupID, ItemName.


    Then I build a form with First Table and add subform with Second table.
    In the sub form, I want to auto populate all item ItemID, ItemName after choosing a GroupID in main form.

    first table: FirstID (primaryKey), GroupID, GroupName ==> will become "main form"
    second table: ItemID, GroupID, ItemName ==> will be "subsorm"
    FirstID GroupID GroupName
    1 1 Big Fruit
    2 2 Small Fruit


    ItemID GroupID ItemName firstID
    1 1 Jack Fruit 1
    2 1 Water Melon 1
    3 2 Berry 1
    4 2 Strawberry 1
    5 2 Apple 1
    6 2 Banana 1


    Your help is much appreciated.

    Sai Han

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    use the subform linkchild/linkmaster properties - based on your examples it would be GroupID in both

    But I would say you should be using your FirstID instead of GrouplID is that is your primary key

    If you set your relationships up, then the link properties should be populated automatically when you create your subform

  3. #3
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,557
    I agree with Ajax

    FirstID instead of GrouplID in the table for the Subform


    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  4. #4
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    And I agree with both above.
    Except I would use GroupID as the linking field (except I named the fields GroupID_PK and GroupID_FK). And I didn't include field FirstID.
    Click image for larger version. 

Name:	Presentation1.png 
Views:	10 
Size:	4.5 KB 
ID:	47956
    Attached Files Attached Files

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

Similar Threads

  1. Replies: 3
    Last Post: 08-13-2020, 02:47 PM
  2. Replies: 3
    Last Post: 11-27-2018, 07:00 PM
  3. Populate list box with query on continous form
    By steve.earle in forum Forms
    Replies: 5
    Last Post: 08-13-2014, 08:38 AM
  4. Replies: 3
    Last Post: 10-10-2013, 08:06 AM
  5. Replies: 10
    Last Post: 10-10-2011, 08:08 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