Can't create count and sum totals at bottom of form

T

tbmarlie

Hello,

I'm trying to create some count and sum totals at the bottom of my
form, but I keep getting #Name? error.

All I'm trying to do is get a sum and count for each type of company
and payroll type from the table that my form is bound to
Master_Table). In this table I have 470 total records which add to
$163,563,76 - I was able to create the Sum and count for these totals
amounts, but when I try to be more specific, I run into problems. I
have 2 companies (I'll call them acme and xyz) and 2 payroll types
(Hourly and Salary). The detail (body) of my form contains all of the
470 records, but what I would like at the bottom is a breakout as
such:

Company Payroll Type Count Sum
acme Hourly 211 $25,906.95
acme Salary 15 $ 7,742.63
xyz Hourly 222 $106,925.79
xyz Salary 22 $ 22,988.39

I thought that since this data could be produced off of Master_Table
(which is the table that the form is bound to) that I could do 4
select queries for each of the control sources in the text boxes such
as SELECT Sum ([Check_Amt]) From Master_Table Where [Company] =
"acme". I keep getting the #Name? error.

Would I need create a subform and bound the subform to the query for
each one of these conditions? Thanks.
 
A

Allen Browne

Perhaps you could add a list box to the Form Footer section.

The RowSource for the list box would be a Totals query that:
- groups by Company and [Payroll Type],
- counts the primary key;
- sums the amount.
 
T

tbmarlie

Perhaps you could add a list box to the Form Footer section.

The RowSource for the list box would be a Totals query that:
- groups by Company and [Payroll Type],
- counts the primary key;
- sums the amount.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.




I'm trying to create some count and sum totals at the bottom of my
form, but I keep getting #Name? error.
All I'm trying to do is get a sum and count for each type of company
and payroll type from the table that my form is bound to
Master_Table). In this table I have 470 total records which add to
$163,563,76 - I was able to create the Sum and count for these totals
amounts, but when I try to be more specific, I run into problems. I
have 2 companies (I'll call them acme and xyz) and 2 payroll types
(Hourly and Salary). The detail (body) of my form contains all of the
470 records, but what I would like at the bottom is a breakout as
such:
Company Payroll Type Count Sum
acme Hourly 211 $25,906.95
acme Salary 15 $ 7,742.63
xyz Hourly 222 $106,925.79
xyz Salary 22 $ 22,988.39
I thought that since this data could be produced off of Master_Table
(which is the table that the form is bound to) that I could do 4
select queries for each of the control sources in the text boxes such
as SELECT Sum ([Check_Amt]) From Master_Table Where [Company] =
"acme". I keep getting the #Name? error.
Would I need create a subform and bound the subform to the query for
each one of these conditions? Thanks.- Hide quoted text -

- Show quoted text -

Thanks Allen - that worked!
 

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

Top