Results 1 to 7 of 7
  1. #1
    Khalil Handal is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    310

    form showing list based on values of combo boxes

    Hi,


    I have a bounded for that shows a list of names. The form has three combo boxes: cboYears, cboLevels and cboSections.
    I want the list to show only the names based on the combo boxes values (to show the names of a specific year and specific level and specific section).
    How can I do this?

    Note:
    The form has also a subform to show more information about the selected name form the list.


    Khalil

  2. #2
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,157
    This sounds like a term called cascading combo's.

    Paul has a example here http://baldyweb.com/CascadingCombo.htm
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    Khalil Handal is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    310
    Hi,
    It is not cascading combo's, It it three criteria together, each value of the criteria is selected from a combo box.
    To explain more:
    I have people added to the database each year, they are divided into groups and each group have sections. So for example, I need to select people from the year 2019, group name is Flowers and section B.

    Khalil

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    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
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    Build the recordsource for the listbox, from the combo values. You need to decide when it is activated, a button perhaps?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  6. #6
    Khalil Handal is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    310
    Hi,
    I have Review http://allenbrowne.com/ser-62.html
    I used it as an example and built my code. The string strWhere shows the correct values from the three combo boxes.

    In Allen Browne example the code applies the filter to the form as in the following two line:

    Code:
    'Finally, apply the string as the form's Filter.
            Me.Filter = strWhere
            Me.FilterOn = True
    I need to apply the the filter for the List Box in the main form. The form also contains a sub form.
    How can I do this?

    Khalil

  7. #7
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    Quote Originally Posted by Khalil Handal View Post
    Hi,
    I have Review http://allenbrowne.com/ser-62.html
    I used it as an example and built my code. The string strWhere shows the correct values from the three combo boxes.

    In Allen Browne example the code applies the filter to the form as in the following two line:

    Code:
    'Finally, apply the string as the form's Filter.
            Me.Filter = strWhere
            Me.FilterOn = True
    I need to apply the the filter for the List Box in the main form. The form also contains a sub form.
    How can I do this?

    Khalil
    https://www.access-programmers.co.uk...-query.245604/
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

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: 3
    Last Post: 08-12-2014, 02:12 PM
  3. Replies: 9
    Last Post: 04-01-2014, 04:29 PM
  4. Replies: 2
    Last Post: 09-24-2013, 11:38 AM
  5. Replies: 1
    Last Post: 03-27-2010, 06:13 AM

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