Results 1 to 7 of 7
  1. #1
    FL0XN0X is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Location
    Belgium
    Posts
    84

    Form with subform and search combobox in main form: subform does not update accordingly


    Hi,

    I have got a form with subform. In the main form, I have added a combobox using the 'Control Wizard' to have a combobox to search for records.
    When I search for records using the combobox, the records in the main form are shown, but the subform is not updated accordingly.

    - Relationships are 'OK'
    - Link Master Fields / Link Child Fields are 'OK'

    What's the clue to have the subform showing the records that are linked to the record that is shown in the main form as a result of a search using the combobox.
    Thank you in advance.
    Kind regards,
    Bart

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I question this statement:

    - Link Master Fields / Link Child Fields are 'OK'

  3. #3
    FL0XN0X is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Location
    Belgium
    Posts
    84
    Hi RuralGuy, thank you for your quick response

    It concerns two tables:

    Customer:

    ID Customer
    1 Jack
    2 John
    3 Els
    4 Nick
    ...

    Weekprofile
    Id Customer_Id WeekprofileName
    1 1
    2 1
    3 2
    4 3
    5 3
    ...

    1 customer can have many Weekprofiles. The Customer_Id in the Weekprofile table is filled by using the lookup tab in the table design.
    Main form is based on Customer table, the subform is based on the Weekprofile table

    In order to make this clear to me, can you guide me step-by-step, please?

    Relationship: 1 customer can have many weekprofiles, I have have a relationship of 1-many between the two tables (ID from Customer table is linked with Customer_ID of WeekProfile).
    Can you confirm that this is correct?

    Link Master Fields: ID
    Link Child Fields: Customer_ID
    Correct?


  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Yes, that does look appropriate.


    A control used to input search criteria must be UNBOUND - no Control Source. Is the combobox UNBOUND?


    Where do the Weekprofile values come from? Is there a lookup table for those? Do you have a combobox on the subform for selecting profile?

    Can really call this a many-to-many relationships: each customer can have many profiles and each profile can associate with many customers.


    If you want to provide the db for analysis, follow instructions at bottom of my post.
    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.

  5. #5
    FL0XN0X is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Location
    Belgium
    Posts
    84
    hey,
    I think I have found the issue .... the subform must be based on a query which gets the ID from the choosen record via the combobox. Until now, I didn't have this query :-S ...
    Working on it now, keep you posted ...

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I believe you are now on the right path.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Wait, the query for the main form should be based on chosen record of the combobox, assuming main form is bound to Customers table. (I never use dynamic parameterized queries, I prefer VBA to set the form Filter and FilterOn properties.) The subform should just be the Weekprofile table or a simple query with no filter criteria. The subform container Master/Child links will synchronize to display only records related to the main form 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.

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

Similar Threads

  1. Replies: 1
    Last Post: 01-16-2015, 09:28 AM
  2. Replies: 3
    Last Post: 03-17-2014, 12:51 PM
  3. Replies: 1
    Last Post: 09-06-2011, 01:47 PM
  4. Replies: 29
    Last Post: 08-16-2011, 05:52 PM
  5. Replies: 0
    Last Post: 08-24-2010, 06:38 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