Sum in textbox on Formfooter


A

Alex

Before, I used to find the sum of a textbox column on a
continuous form in the textbox on a formfooter.

But, now it gives an error there and I cannot get why.

I'm trying =Sum([TableField]) or =Sum([txtTextBox]),
txtTextBox is associated with TableField, in the Control
Source property for the textbox.

Could anybody give any advice?

Thanks
 
Ad

Advertisements

A

Alex

I've forgotten to mention the following:
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.

Thanks
 
V

Van T. Dinh

Try:

Me.txtTotalStaffDay.ControlSource = "=Sum([StaffDay])"

or

Me.txtTotalStaffDay.ControlSource = "=Sum([txtStaffDay])"


--
HTH
Van T. Dinh
MVP (Access)


Alex said:
I've forgotten to mention the following:
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.

Thanks


-----Original Message-----
Before, I used to find the sum of a textbox column on a
continuous form in the textbox on a formfooter.

But, now it gives an error there and I cannot get why.

I'm trying =Sum([TableField]) or =Sum([txtTextBox]),
txtTextBox is associated with TableField, in the Control
Source property for the textbox.

Could anybody give any advice?

Thanks
.
 
A

Alex

Thanks a lot.
I've got the total once by using this.
But, next the form downloading gives the error again.

Something is wrong somewhere anyway.
-----Original Message-----
Try:

Me.txtTotalStaffDay.ControlSource = "=Sum ([StaffDay])"

or

Me.txtTotalStaffDay.ControlSource = "=Sum ([txtStaffDay])"


--
HTH
Van T. Dinh
MVP (Access)


I've forgotten to mention the following:
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.

Thanks


-----Original Message-----
Before, I used to find the sum of a textbox column on a
continuous form in the textbox on a formfooter.

But, now it gives an error there and I cannot get why.

I'm trying =Sum([TableField]) or =Sum([txtTextBox]),
txtTextBox is associated with TableField, in the Control
Source property for the textbox.

Could anybody give any advice?

Thanks
.

.
 
Ad

Advertisements

A

Alex

Thanks a lot.
I'm using the following now:

Me.txtTotalStaffDay.Value = DSum("StaffDay", strCode)

It works.

Regards,

Alex
-----Original Message-----
Thanks a lot.
I've got the total once by using this.
But, next the form downloading gives the error again.

Something is wrong somewhere anyway.
-----Original Message-----
Try:

Me.txtTotalStaffDay.ControlSource = "=Sum ([StaffDay])"

or

Me.txtTotalStaffDay.ControlSource = "=Sum ([txtStaffDay])"


--
HTH
Van T. Dinh
MVP (Access)


I've forgotten to mention the following:
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.

Thanks



-----Original Message-----
Before, I used to find the sum of a textbox column on a
continuous form in the textbox on a formfooter.

But, now it gives an error there and I cannot get why.

I'm trying =Sum([TableField]) or =Sum([txtTextBox]),
txtTextBox is associated with TableField, in the Control
Source property for the textbox.

Could anybody give any advice?

Thanks
.

.
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top