Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2004
    Posts
    3

    Unanswered: Query / Report Sorting and some VBA

    I created a form that allows users to make a custom search. This includes sorting.

    I wrote VBA that creates a query (w/ sorting et al) and then opens a report (which uses the above query as the recordset).

    Problem is: The sorting is correct in the query but not in the report. Grouping and sorting in the report will not allow me to set it to nothing as well. Is there a way to dynmaically change the sorting and grouping for a report or i there a way to force the report to simply show the data in the same order that it appears in the query?

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Remove the grouping and sorting from the report.
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Jul 2004
    Posts
    3
    I do, but Access complains (You must define a sort field or expression for the group header or footer in the report that you tried to preview or print).

    I do have a report head and footer and page header and footer, but no more.

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Grouping levels in a report will always override the grouping levels in the datasource. One method I use to get around this is to create a "dummy" grouping level and set it dynamically in the on open event of the report using:

    me.GroupLevel(0).ControlSource = whatever

    basically you have to play with that grouplevel method if you want to be able to alter grouping in a report.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

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