PDA

View Full Version : Display column totals in a split form datasheet



Marcster
06-04-2013, 08:48 AM
I have a split form with the Datasheet on the bottom of screen.
When I view this form, on the in built default Access Ribbon
there is a button: Home > Records > Totals
When I click on this a Totals Row appears at bottom of datasheet.
It is this controls action I'm trying to get at.
As it seems that in RunTime mode, that option/code cannot be run.
I've created a custom Ribbon:
<group id ='GroupRecordsTotal'
label='Totals'>
<toggleButton idMso='RecordsTotals'
size='large'/>
</group>
But although gives no error, doesn't work in runtime mode but does in a .accdb file.
I can with VBA make the TotalsRow appear on a query datasheet output view:
Dim db As DAO.Database
Dim qd As DAO.QueryDef
Set db = CurrentDb()
Set qd = db.QueryDefs("QueryNameHere")
qd.Properties("TotalsRow") = True

In Help:
Tables > Display column totals in a datasheet

But how do I get to toggle this TotalsRow in RunTime mode?.

Marcster
06-11-2013, 01:11 AM
After investigating this, it seems that this functionlity is disabled in runtime (.accdr) mode.

informer
10-20-2016, 03:39 AM
Hi Marcster

Could you help me and precise me on which event do you set the code above?


My context:

A subform in datasheet mode which displays data from a query. But I have no idea where to add your code below:


Dim db As DAO.Database
Dim qd As DAO.QueryDef
Set db = CurrentDb()
Set qd = db.QueryDefs("QueryNameHere")
qd.Properties("TotalsRow") = True

Thanks by advance for your help :bump: