Hide footers when not needed

tweetyksc

Registered User.
Local time
Today, 19:40
Joined
Aug 23, 2001
Messages
87
I have a report that can be run for all or filtered.
There are groups on the report for Sales Reps and Sales Area (Sales reps are in a Sales Area). Both groups have a footer with totals. The report footer holds grand totals for the columns.

The Sales Reps footer/totals would always be needed because they are always on the report; but if a Report is run for a specific sales area, the grand total (report footer) is redundant. Likewise, if running for one sales rep, the Sales Area footer and report footer totals would be redundant.

Is there a way to check the report and hide the appropriate footers, i.e. if <2 sales reps, the area/report footer would be hidden, etc.? I know how to put a hidden text box at the end to have the running total in the group, but don't know where to proceed from there.

In the past, I've created separate reports, but I'm trying to tighten up things and not have unnesessary things in the database if possible!
 
Well, I was able to HIDE the footers when they are not needed,
but there is still an extra page that prints because the grand total (report footer) is set to print on a separate page (needs to be that way so it is not on a rep's page).

This is what I put in the report module, after creating a text box that does a running count of the number of reps, and putting the total (txtRepTotal) in the report footer:

-----------------
Private Sub AreaFooter_Format(Cancel As Integer, FormatCount As Integer)
If txtRepTotal < 2 Then
AreaFooter.Visible = False
ReportFooter.Visible = False
End If
End Sub
---------------
I'm thinking that because the total (which I need) is in the footer, I can't just have it not format?
Anybody?
 

Users who are viewing this thread

Back
Top Bottom