View Single Post
  #2  
Old August 28th, 2005, 03:40 AM
Steve Schapel
external usenet poster
 
Posts: n/a
Default

Darin,

You mentioned that you "know how to count the groups, then hide the
report footer if there's only one group", so... why can't you just do
the same thing, i.e. count the groups, and hide the group footer if
there's only one group? There are a number of ways you could "count the
groups" for the purpose of toggling the visibility of the group footer
section. One would be to open a recordset and get a count, for example...
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("SELECT DISTINCT GroupID FROM
YourQuery")
rst.MoveLast
Me.Section(6).Visible = rst.RecordCount 1

Another would be to make a query based on 'SELECT DISTINCT GroupID FROM
YourReportQuery' and then use this in your code...
Me.Section(6).Visible = DCount("*","YourGroupsQuery") 1

--
Steve Schapel, Microsoft Access MVP


Darin wrote:
I have a report that sub-totals on a group, then grand-totals at the
report footer. If there's only one group, the sub-total and grand
total are redundant, so I only want to show one of them. I know how to
count the groups, then hide the report footer if there's only one
group, but my problem is I want to hide the group footer (sub-total),
not the report footer (because the report footer references what the
grand total is for, which is always necessary, while the group footer
references the sub-category that the sub-total is for, which isn't
necessary if there's only one sub-category).

The standard solution of getting a running count doesn't work, because
by the time it has reached the first group footer, the count is still
"1", since it hasn't gotten to the second group yet. The end result is
the group footer is shown from the 2nd group and on, but the first
group gets omitted.

Any ideas?

Thanks!