Sum specific data on an rpt

G

Guest

I have an expression on a report that is not being saved in a table. In the
control source I have the following...
=[Expr1]/[EMPLOYEE TIME]

I want to be able to single out a specific supervisor in that report. For
example, Larry shows up 4 times on the report. I want Expr1 summed up and
EMPLOYEE TIME summed and then divided by each to only have Larry's data. how
do I incorporate the Supervisor aspect into my expression without creating
another query?
 
G

Guest

Hi Chad

You need to filter the report. There are a number of methods you can use.
eg.

Create an unbound combo in your form (use the wizard if nes). Ensure that
you have the supervisor primary field and name. Call it cboSupervisor
Also on the form have a button with this OnClick event
DoCmd.OpenReport "ReportName", acViewPreview, "", "", acNormal

Open the query the report is based on.
In the column that holds the primary field of the supervisor put this
Forms![FormName]![cboSupervisor]

Although in this case you may be better using QBF in case you want to see
all the records so use this instead of the above if this may be the case
Forms![FormName]![cboSupervisor] Or Forms![FormName]![cboSupervisor] Is Null


Another method
Add a button to your form with this OnClick event
DoCmd.OpenReport "ReportName", acViewPreview, "",
"[PrimaryFieldInReport]=[Forms]![FormName]![cboSupervisor]", acNormal

You could also use the above to produce a sub report (can shrink/grow = Yes)
that you could place in the report footer of you main report. etc etc.

There are a quite a few more methods of filtering your report.

Good luck
 
G

Guest

Thanks Wayne, I went with one that was given in another forum just after it
was posted and it works great. Its was what I really wanted to do instead of
using something in my query since the data is only for a visual and not
stored anywhere.

=Sum(IIf([Supervisor]='supvisors name',[DT REGULAR],0)) /
Sum(IIf([Supervisor]='supervisor',[Employee Time],0))

Thanks for spending the time on trying to help me.....

Reguards,
Chad


Wayne-I-M said:
Hi Chad

You need to filter the report. There are a number of methods you can use.
eg.

Create an unbound combo in your form (use the wizard if nes). Ensure that
you have the supervisor primary field and name. Call it cboSupervisor
Also on the form have a button with this OnClick event
DoCmd.OpenReport "ReportName", acViewPreview, "", "", acNormal

Open the query the report is based on.
In the column that holds the primary field of the supervisor put this
Forms![FormName]![cboSupervisor]

Although in this case you may be better using QBF in case you want to see
all the records so use this instead of the above if this may be the case
Forms![FormName]![cboSupervisor] Or Forms![FormName]![cboSupervisor] Is Null


Another method
Add a button to your form with this OnClick event
DoCmd.OpenReport "ReportName", acViewPreview, "",
"[PrimaryFieldInReport]=[Forms]![FormName]![cboSupervisor]", acNormal

You could also use the above to produce a sub report (can shrink/grow = Yes)
that you could place in the report footer of you main report. etc etc.

There are a quite a few more methods of filtering your report.

Good luck

--
Wayne
Manchester, England.



Chad said:
I have an expression on a report that is not being saved in a table. In the
control source I have the following...
=[Expr1]/[EMPLOYEE TIME]

I want to be able to single out a specific supervisor in that report. For
example, Larry shows up 4 times on the report. I want Expr1 summed up and
EMPLOYEE TIME summed and then divided by each to only have Larry's data. how
do I incorporate the Supervisor aspect into my expression without creating
another query?
 

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