From: Marshall Barton on
NEWER USER wrote:

>I jumped the gun too early. It didn't work as expected with further testing.
>Case 1 - Suspends two group levels, hides 2 headers and 1 footer. Works okay.
>
>Case 2 - Suspends 1 group level, 1 header and 1 footer. Not working.
>
>Case 3 - Shows all; no hidning. Works okay.
>
>Case 2 and Case 3 are producing identical reports; the group level is not
>suspending in Case 2 nor hiding header/footer. Any ideas why?
>
>Private Sub Report_Open(Cancel As Integer)
>On Error GoTo Report_Open_Err
> DoCmd.ShowToolbar "iTurns Command Bar", acToolbarNo
>Select Case Forms!PrintReportsDialog.[Select Sales Rankings]
> Case 1 'IMC Sales/Part Name
> If Forms!PrintReportsDialog.[Select Sales Rankings] = 1 And
>Forms!PrintReportsDialog.[Select Grouping] = 1 Then
> Me.GroupLevel(0).ControlSource = "='Suspend' "
> Me.GroupLevel(2).ControlSource = "='Suspend' "
> Me.GroupHeader0.Visible = False
> Me.GroupHeader2.Visible = False
> Me.GroupFooter1.Visible = False
> Me.GroupFooter3.Visible = False
> Me.GroupLevel(1).ControlSource = "PartName"
> Me.GroupLevel(1).SortOrder = False
> Me.OrderBy = "Sales DESC"
> Me.OrderByOn = True
> End If
> Case 2 'IMC Sales/Region/Part Name
> If Forms!PrintReportsDialog.[Select Sales Rankings] = 1 And
>Forms!PrintReportsDialog.[Select Grouping] = 2 Then
> Me.GroupLevel(2).ControlSource = "='Suspend' "
> Me.GroupHeader2.Visible = False
> Me.GroupFooter3.Visible = False
> Me.GroupLevel(0).ControlSource = "tblType.Make"
> Me.GroupLevel(1).ControlSource = "PartName"
> Me.GroupLevel(0).SortOrder = False
> Me.GroupLevel(1).SortOrder = False
> Me.OrderBy = "Sales DESC"
> Me.OrderByOn = True
> End If
> Case 3 'IMC Sales/Region/Part Name/Make
> If Forms!PrintReportsDialog.[Select Sales Rankings] = 1 And
>Forms!PrintReportsDialog.[Select Grouping] = 3 Then
> Me.GroupLevel(0).ControlSource = "tblType.Make"
> Me.GroupLevel(1).ControlSource = "PartName"
> Me.GroupLevel(2).ControlSource = "tblCode.Make"
> Me.GroupLevel(0).SortOrder = False
> Me.GroupLevel(1).SortOrder = False
> Me.GroupLevel(2).SortOrder = False
> Me.OrderBy = "Sales DESC"
> Me.OrderByOn = True
> End If
>End Select


Nothing in case 2 jumps out at me as being wrong.

I would first double check to make sure you have the
header/footer section names correct and use a break point to
verify that [Select Sales Rankings] = 1 and [Select
Grouping] = 2 when you get to case 2.

--
Marsh
MVP [MS Access]
First  |  Prev  | 
Pages: 1 2
Prev: display a total value
Next: Charts on a Report