Total on a continious form

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

I cannot get total on a continious form.
When I'm doing it directly using a specific table I can
get Total for column in the formfooter on a continious
form. But, I want to use different tables' names and I'm
using Sub Form_Load to download data from different
tables. Everything is working fine except Total for column
in the formfooter.

Private Sub Form_Load()
......
Me.RecordSource = strCode ' it's a table name
Me.cboOperation.ControlSource = "Operation"
Me.txtStaffDay.ControlSource = "StaffDay"
Me.txtShiftDay.ControlSource = "ShiftDay"
Me.txtStaffAFT.ControlSource = "StaffAFT"
Me.txtShiftAFT.ControlSource = "ShiftAFT"
Me.cboRateCode.ControlSource = "Rate Code"
' Up to here everything is fine

Me.txtTotalStaffDay.ControlSource = "=Sum([" & strCode
& "]![StaffDay])" ' error
Doing it directly on the form using form's property
(without VB) - Control Source =Sum([StaffDay]) gives the
same error.

Please, help.

Thanks
 
You can't use Sum like that. Try using the domain function DSum:

=DSum("StaffDay", "Operation")
 
Thanks a lot.
It looks like it's working perfectly.DSum("StaffDay",
strCode).

Regards,

Alex

I'm using Me.txtTotalStaffDay.Value=
-----Original Message-----
You can't use Sum like that. Try using the domain function DSum:

=DSum("StaffDay", "Operation")


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I cannot get total on a continious form.
When I'm doing it directly using a specific table I can
get Total for column in the formfooter on a continious
form. But, I want to use different tables' names and I'm
using Sub Form_Load to download data from different
tables. Everything is working fine except Total for column
in the formfooter.

Private Sub Form_Load()
.....
Me.RecordSource = strCode ' it's a table name
Me.cboOperation.ControlSource = "Operation"
Me.txtStaffDay.ControlSource = "StaffDay"
Me.txtShiftDay.ControlSource = "ShiftDay"
Me.txtStaffAFT.ControlSource = "StaffAFT"
Me.txtShiftAFT.ControlSource = "ShiftAFT"
Me.cboRateCode.ControlSource = "Rate Code"
' Up to here everything is fine

Me.txtTotalStaffDay.ControlSource = "=Sum([" & strCode
& "]![StaffDay])" ' error
Doing it directly on the form using form's property
(without VB) - Control Source =Sum([StaffDay]) gives the
same error.

Please, help.

Thanks


.
 
Back
Top