Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Reports - Grouping Problem 1

Status
Not open for further replies.

petecass

Programmer
Jul 30, 2004
19
GB
Hi,
I have a system in place where one visual basic form is used for all reports and allows selection and sort criteria to be established. Problem I am getting is that I have these groupings Customer,Area,District,Site, Position.
But am trying to use the same report to group as above or just site,position. In vba code if selection is not to group by customer,area,district then I hide these groupings. i.e. groupheadercustomer.visible=false etc
Unfortunately the output is the same as if these groupings are displayed just no headers or footers. How can I actually delete these groupings?
 
This code does not delete the group it merely changes the grouplevel source. Hope that perhaps this can help you.
Private Sub Report_Open(Cancel As Integer)
Dim P_Sort
P_Sort = Forms!Lister!D_Sort
If Not IsNull(P_Sort) Then
Select Case P_Sort
Case 1: Me.GroupLevel(0).ControlSource = "Company"
Case 2: Me.GroupLevel(0).ControlSource = "D_ID"
Case 3: Me.GroupLevel(0).ControlSource = "PosttalCode"
Case 4: Me.GroupLevel(0).ControlSource = "Phonr"
End Select
End If
End Sub


Herman

They say that crime doesn't pay... does that mean my job is a crime?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top