*Glen* said:
I'd hate to tell you this, but the code makes no difference. I inputted
it
exactly as shown.
Maybe I forgot to mention something or was not clear. Here is a recap: I
have a table which contains a field named "Staff_Section." Some fields
have
a staff section entered while some do not. On my report, I have a footer
that summs all the fields that belong to a particular staff section.
Please
see below for an example:
Division "A" 2008 Total 2009 Total
Area 1 1 3
Area 2 1 2
Area 3 2 1
Divison Total 4 6
Division "B" 2008 Total 2009 Total
Area 1 1 1
Area 2 3 2
Area 3 1 1
Division Total 5 4
Staff Sec Tot 9 10
**********Staff Section "A"*******
Division "C" 2008 Total 2009 Total
Area 1 1 3
Area 2 1 2
Area 3 2 1
Divison Total 4 6
Division "D" 2008 Total 2009 Total
Area 1 1 1
Area 2 3 2
Area 3 1 1
Division Total 5 4
***Staff Sec Tot 9 10********
***Notice that in the first example, there is no Staff Section identified,
but in the second example, Divisions C & D are subordinates of Staff
Section
A. There is a footer for the Staff Section which summs both divisions.
I do not want there to be a Staff Section footer in the first table
because
there is not staff section associated with it. The staff section fields
are
all empty.
Now you've given another vital bit of information. As I now understand it,
your report is grouped by Staff_Section, and you want to hide the entire
group footer if the Staff_Section field is Null. Is that correct?
If so, the easiest way to do that is to use the Format event of the group
footer to check if the Staff_Section is Null, and cancel the event if it is.
Code for that might look like this:
'------ start of code ------
Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)
If IsNull(Me.Staff_Section) Then
Cancel = True
End If
End Sub
'------ end of code ------
Now, I don't know for sure that Staff_Section is the first group on your
report, and so would be group 0, with its group footer named "GroupFooter0".
What you should do is open the report in design view, click on the footer
bar for that says Staff_Section Footer, open its property sheet, go to the
Event tab, set the On Format property to [Event Procedure], then click the
build button (caption "...") at the end of the line. That will create and
display the shell of the event procedure, and you can paste just the body of
the procedure above into it.
--
Dirk Goldgar, MS Access MVP
Access tips:
www.datagnostics.com/tips.html
(please reply to the newsgroup)