Results 1 to 8 of 8
  1. #1
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Burgas, Bulgaria
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Filter Listbox (Access 2000)

    How can i change the row source of a list box in a form so that to be filtered for each month ? For example i have a list box enumerating the profits of the afiliates.I want by choosing the month to show the records of the ofices for that month only ?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Filter Listbox (Access 2000)

    You can change the design of Query2 so that it includes only the selected office and month.
    If you do that, you only need to requery List12 when the user selects an office or a month, i.e. in the After Update event of the Office and Monaten group boxes.
    See the attached version

  3. #3
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Burgas, Bulgaria
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filter Listbox (Access 2000)

    Dear Hans

    So many thanks for your reply. Your attached version works so fine andi have no problems with this query. The solution is perfect ! Everybody enjoys this beautiful solution of the problem !
    Could you see please my query called qryMonthlyoutlays. I have tried to build the Listbox with the wizard, based on this query,but i fail to do it, it gives me errors.

    Kind regards

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Filter Listbox (Access 2000)

    You have noted that I created an intermediary query Query2a that contains the complex criteria that refer to the Office and Monaten group boxes on the form. This is not a totals query. The totals query Query2 is based on Query2a. It is not possible, at least not easily, to combine these two queries into one.
    Similarly, you must first create a 'normal' query for the outlays with the criteria, and then create a totals query based on the first one. In the attached database, I edited query3 to be the first query, then edited qryMonthlyOutlays so that it is based on query3.
    You can use the List Box Wizard to create the new list box, but it isn't very hard to create it manually, copying the way the first list box is set up. Only now use qryMonthlyOutlays as row source.
    And of course, you must add code to the After Update events of the group boxes to requery the new list box too.

  5. #5
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Burgas, Bulgaria
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filter Listbox (Access 2000)

    Thank you for all that Hans ! You are so great ! I have finished with this task. My colleagues look at me with an admiration and i have explained to them that it is you who we should admire

    Have a great day !

  6. #6
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Burgas, Bulgaria
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filter Listbox (Access 2000)

    Please allow me to refer to this post since it is with this post that you have given me the solution to filter the listobx. I simply wanted to add another list box, based on the query qryMonthlyGain. I couldnt build the list box, i got the message "No value given". Could yo help me build the lis box ?

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Filter Listbox (Access 2000)

    You can duplicate List12 (select List12, then select Edit | Duplicate).
    Rename the duplicate, and modify the properties you need, such as the Row Source.

    (BTW, the result of qryMonthlyGain seems to be the same as that of Query2)

  8. #8
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Burgas, Bulgaria
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Filter Listbox (Access 2000)

    Thank you !!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •