Turn off Totals Row

  • Thread starter Thread starter Stephen Lynch
  • Start date Start date
S

Stephen Lynch

In a subform I have a totals row in access 2007. I want to set code to turn
it off, anyone know how?

For example.

Me.frmtblContributionssub.Form.TurnOffTotals = True

Thanks
 
Stephen Lynch said:
In a subform I have a totals row in access 2007. I want to set code to
turn it off, anyone know how?

For example.

Me.frmtblContributionssub.Form.TurnOffTotals = True

Thanks

Presuming the totals row is in the subform's footer section, the code you
need is:

Me.frmtblContributionssub.Form.Section(acFooter).Visible = False
 
Thanks Stuart, but it doesn't remove the totals row in access 2007.

Any other thoughts? I did see somewhere that it could be controlled by

I don't see anything in the help about this, but with a bit of experimenting
you can figure out what is being displayed. A QueryDef in Access 2007 has a
TotalsRow property (true/false) indicating if the total row is being
displayed. Each field in the QueryDef has an AggregateType property
indicating what type of aggregation is to be shown for that column. The
value is a Long, where:
-1 = don't show anything
0 = the first item in the list (i.e. Sum)
1 = the 2nd item in the list (i.e. Average)
and so on. It is therefore possible to determine whether the total row is
turned on, and what aggregate value is showing in each row, e.g.:
CurrentDb.QueryDefs("Query1").Fields("Field2").Properties("AggregateType")
Note that you have to save the query for that to work.
 
Stephen Lynch said:
Thanks Stuart, but it doesn't remove the totals row in access 2007.

Any other thoughts? I did see somewhere that it could be controlled by

I don't see anything in the help about this, but with a bit of
experimenting
you can figure out what is being displayed. A QueryDef in Access 2007 has
a
TotalsRow property (true/false) indicating if the total row is being
displayed. Each field in the QueryDef has an AggregateType property
indicating what type of aggregation is to be shown for that column. The
value is a Long, where:
-1 = don't show anything
0 = the first item in the list (i.e. Sum)
1 = the 2nd item in the list (i.e. Average)
and so on. It is therefore possible to determine whether the total row is
turned on, and what aggregate value is showing in each row, e.g.:

CurrentDb.QueryDefs("Query1").Fields("Field2").Properties("AggregateType")
Note that you have to save the query for that to work.


I'm unable to help with this, not yet having A2007, sorry. I've been retired
for two years now, and the imperative to keep up to date is much reduced.

I hope someone else can help.
 
Back
Top