How do I use SORT and FILTER feature on access 2003

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wassimdaccache
    New Member
    • Apr 2007
    • 222

    #1

    How do I use SORT and FILTER feature on access 2003

    Dear,

    Does MS access 2003 provide user to use the command sort and filter in a report ?

    let us say I have many fields. User needs to choose each time a field to sort and then to print. Same idea to filter mode.

    Any help would appreciated.


    Thank you in advance.

    WASSIM S DACCACHE
  • Stewart Ross
    Recognized Expert Moderator Specialist
    • Feb 2008
    • 2545

    #2
    Hi Wassim. Access does not provide user-level sorting for reports; the sort order is built-in as part of the report's structure, determined by the Sorting and Grouping settings. These are changeable using VBA code, but not from a menu option the way form sorting can be done.

    Similarly, user-level filtering is not a feature provided for reports as a menu option. It is a simple matter to apply a filter to a report in the OpenReport call statement, or to set a filter within the VBA calling routine and apply it at run-time, and the developer would normally provide the users with choices using a form to do so then open the report for the user, filtering at that stage.

    -Stewart

    Comment

    • wassimdaccache
      New Member
      • Apr 2007
      • 222

      #3
      Originally posted by Stewart Ross Inverness
      Hi Wassim. Access does not provide user-level sorting for reports; the sort order is built-in as part of the report's structure, determined by the Sorting and Grouping settings. These are changeable using VBA code, but not from a menu option the way form sorting can be done.

      Similarly, user-level filtering is not a feature provided for reports as a menu option. It is a simple matter to apply a filter to a report in the OpenReport call statement, or to set a filter within the VBA calling routine and apply it at run-time, and the developer would normally provide the users with choices using a form to do so then open the report for the user, filtering at that stage.

      -Stewart
      Dear Stewart,
      I appreciate your help.
      Actually I have an IDEA and not able to implement.

      The idea is to have a form and let user do all kinds of filter and sort( it is already done). after that a method to copy the source of the form modified by the user (sorted and filter) into the source of the report that I need to print.
      It is possible to copy the source of a form and past it on a source of a report on access.?

      By the way does access 2007 provide us sort as a menu option in a report ???

      Thank you in advance.


      WASSIM S DACCACHE

      Comment

      • Stewart Ross
        Recognized Expert Moderator Specialist
        • Feb 2008
        • 2545

        #4
        Sorry, Wassim, but changing the recordset of a report cannot affect its sorting and grouping, which is 'hard wired' into the report when it is built. It can be changed under program control, but not by setting a new recordsource.

        There are likely to be only two or three sorting variants of any one report, and in my opinion the easiest option is to save alternative versions of the completed report with different sorting and grouping, and open the appropriate report depending on the choice selected by the user.

        -Stewart

        Comment

        • ADezii
          Recognized Expert Expert
          • Apr 2006
          • 8834

          #5
          To a certain degree, you can pro-grammatically control Sort Orders for various Grouping Levels, as well as Grouping Options, as in:
          Code:
          Private Sub Report_Open(Cancel As Integer)
            'GroupLevel(0) = 1st Grouping Level
            Me.GroupLevel(0).SortOrder = False       'Ascending Order
            Me.GroupLevel(0).GroupOn = 0             'Each Value
            Me.GroupLevel(0).GroupInterval = 1       'Each Value
            Me.GroupLevel(0).KeepTogether = 1        'Whole group
          End Sub

          Comment

          Working...