Results 1 to 11 of 11
  1. #1
    2 Star Lounger
    Join Date
    Aug 2005
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Order results second time (Access 2000)

    I want to order the results in the form first by affiliate and second by month. After i order the results by afiliate i want to click on the second option group and choose the month.How can i do that ? In the end result i want the results ordered by the chosen affiliate and by the chosen month.In my attachement the results are ordered only by affiliate.I need help to order the results second time by month

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

    Re: Order results second time (Access 2000)

    Don't you mean filtered instead of ordered? Once you have selected a month, there is no need to order the records by month, since there is only one month.

  3. #3
    2 Star Lounger
    Join Date
    Aug 2005
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Order results second time (Access 2000)

    Thank you ! Of course. After i select the month i need the results to be filtered for the chosen affiliate. Therefore i mean filtered and not orderred.i need to click two times. First to select the affiliate and second to select the month.

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

    Re: Order results second time (Access 2000)

    See attached version. I added a common procedure that is called both when Office is clicked and when Monaten is clicked.

  5. #5
    2 Star Lounger
    Join Date
    Aug 2005
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Order results second time (Access 2000)

    Oh Hans , what you have suggested is so perfect ! It is beyond my expectations. I have added a control summing the results and now i have such a flexible form !

    Thank you so much !

  6. #6
    2 Star Lounger
    Join Date
    Aug 2005
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Order results second time (Access 2000)

    Dear Hans. How could i differentiate between the years ? I need to add another button for the year 2006 and 2007.Can i somehow tie up this button with the code ?

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

    Re: Order results second time (Access 2000)

    Instrad of using two command buttons, I'd use another option group Years (or a combo box). You can then add code to the SetRecordSource procedure similar to that for Monaten, but with Year(OutlayDate) instead of Month(OutlayDate). Call SetRecordSource from the After Update event of Years too.

  8. #8
    2 Star Lounger
    Join Date
    Aug 2005
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Order results second time (Access 2000)

    Thank you. The inclusion of the new option group and the procedure into the code seems not to have any effect on he selection.Why is it so ?

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

    Re: Order results second time (Access 2000)

    You have attached an old version of the database.

  10. #10
    2 Star Lounger
    Join Date
    Aug 2005
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Order results second time (Access 2000)

    I am so sorry, i have mixed them up in the hurry

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

    Re: Order results second time (Access 2000)

    There are several problems.

    1) You have not created an After Update event procedure for the Jahr option box.

    2) You haven't set the option values for the option buttons in Jahr correctly - they should be 2006 and 2007, not 1 and 2.

    3) You duplicated the code <code>If Not strWhere = "" Then ... End If</code>. This causes an error because the word WHERE occurs twice.

    See attached version.

Posting Permissions

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