total on datasheet and subform

DevAccess

Registered User.
Local time
Today, 09:30
Joined
Jun 27, 2016
Messages
321
Hello

I have total field which I placed on datasheet view of the table and it works correct but I have this table refer on subform which does not total field at all, any guess?


Thanks
 
Best not use a table as Source Object for a subform. Construct a form based on the table and use a ControlSource of a textbox in the footer to get the total.

Code:
= Sum(fieldname)

The footer will not display in Datasheet View but the ControlSource of a textbox on the main form can refer to it.

Code:
= subformcontrolname.controlname
 
Best not use a table as Source Object for a subform. Construct a form based on the table and use a ControlSource of a textbox in the footer to get the total.

Code:
= Sum(fieldname)

The footer will not display in Datasheet View but the ControlSource of a textbox on the main form can refer to it.

Code:
= subformcontrolname.controlname

Hi Glaximom, thanks for your reply but the design is on production and there are efforts involved to make them modify so could you please help me in this process as I had followed yesterday and see if you can help me in that.

I created one txtTotal field on subform footer that includes the the field which totals the value of one row of fields on the form.

txtTotal = sum([txtTotalShow])

and then I refer this field on the main form as below


txtTotalMain = [ftimesheet].[Form]![txttotal]

but it gives #Name? error on the form.
 
I created one txtTotal field on subform footer that includes the the field which totals the value of one row of fields on the form.

txtTotal = sum([txtTotalShow])

Does this control show a result when that form object is opened in Form mode? Just to be clear, neither of these textboxes's control sources should not have anything to the left of the equal sign.

and then I refer this field on the main form as below

txtTotalMain = [ftimesheet].[Form]![txttotal]

but it gives #Name? error on the form.

Usually this is because the name of the subformcontrol is incorrect. It should be the subform control name rather than the name of the subform object itself.
 

Users who are viewing this thread

Back
Top Bottom