Change Groupings in Report

duluter

Registered User.
Local time
Today, 04:33
Joined
Jun 13, 2008
Messages
101
Hi.

I searched the archive through Google, but didn't find what I was looking for (though it seems certain that this question has been asked before).

I have four reports, all generated from the same query. The only differences among the reports is the way the data is grouped.

Is it best to keep these as four separate reports, or is it better to create one report and somehow programmatically alter the groupings depending on which version of the report I want? I suspect that the four separate reports option is the way to go, for simplicity. But this seems a little lame because if I have any formatting edits to make, then I have to make those edits in four separate places.


Thanks,

Duluter
 
Do you have control int he group header and/or footer sections? I am not sure if it is possible.


Are you only changing the sort order? It is possible to change the sort order with VBA.

Example code for the On Open event:
Code:
    Select Case Forms!frmChooseSort!grpSort
    Case 1 'Name
        Me.GroupLevel(0).ControlSource = "LastName"
        Me.GroupLevel(1).ControlSource = "FirstName"
        Me.GroupLevel(2).ControlSource = "Company"
    Case 2 'Company
        Me.GroupLevel(0).ControlSource = "Company"
        Me.GroupLevel(1).ControlSource = "LastName"
        Me.GroupLevel(2).ControlSource = "FirstName"
    End Select
 
Hmm, it seems like what I'm after would probably be a real pain to implement. If you switch around the groupings and sort orders, then you'd need to reassign which fields get placed in which controls in the report body. And you'd also probably need to move those controls to different locations on the page. I think I'll pass.

Thanks for your input, HiTech.


Duluter
 
Last edited:

Users who are viewing this thread

Back
Top Bottom