Results 1 to 3 of 3
  1. #1
    Remsky is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2019
    Location
    Netherlands
    Posts
    4

    Filter list values in subform based on list value selection of another field in same sub form

    I am hitting a wall here... I have figured out so much about Access (2019) since I started a week ago but I'm truly stuck.
    I have a subform in which I have 2 combo boxes. The first combo box should operate as a filter on the second combo box.
    See attachment for DB Structure of relevant tables.

    The main form is linked to tblMutKop (header information regarding the underlying financial entries)
    The sub form is linked to tblMutDet (all individual financial entries).
    First combo box: list values from tblSTAM_Rel (=customers table).
    Second combo box: list values from tblMutKop.

    Question: how can I, in the second combo box, only show 'Datum' and 'Factuurnummer' of MutKop records with the in combo box 1 selected 'RelCode' (which is NOT the 'RelCode' from the main form)?


    Code:
    SELECT 'Datum', 'Factuurnummer' FROM MutKop WHERE 'RelCode' = <RelCode combo Box 1>
    How can I make this work?
    Attached Thumbnails Attached Thumbnails Schermafbeelding 2019-10-29 om 15.06.55.jpg   Schermafbeelding 2019-10-29 om 15.29.58.png  
    Last edited by Remsky; 10-29-2019 at 08:30 AM. Reason: Added screenshot of data entry form

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    This is known as cascading combobox/listbox and common topic in many forums.

    SELECT Datum, Factuurnummer FROM MutKop WHERE RelCode = [combobox1name];

    Then you need some code in VBA to requery combobox.
    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.

  3. #3
    Remsky is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2019
    Location
    Netherlands
    Posts
    4
    Quote Originally Posted by June7 View Post
    This is known as cascading combobox/listbox and common topic in many forums.

    SELECT Datum, Factuurnummer FROM MutKop WHERE RelCode = [combobox1name];

    Then you need some code in VBA to requery combobox.
    Thanks, I was so close without even knowing it!
    And not knowing the exact terminology made it more difficult as well. Sorry for that...

    After setting up the requery thing it's working now as a charm!!

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

Similar Threads

  1. Replies: 27
    Last Post: 10-30-2019, 01:27 PM
  2. Replies: 2
    Last Post: 10-03-2018, 10:52 PM
  3. Replies: 3
    Last Post: 01-16-2015, 04:37 PM
  4. Replies: 9
    Last Post: 10-16-2012, 07:51 AM
  5. Replies: 1
    Last Post: 03-01-2009, 09:53 AM

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