problem with a subreport

W

wayne zabel

I have a report (reporta) which contains a subreport (reportb). Reporta is a
listing of all products run on a production line during a specified period.
Each record contains the qty manufactured, and a start time and an end time.
It calculates the total running time and compares the time to make the
actual production qty to an established standard and calculates an
efficiency percentage. All works fine so far. Now I want to address
downtime. I have a separate table with downtime events. Reportb addresses
the downtime events. I have linked the reports by ID numbers and everything
works for production runs with downtime. It subtracts the downtime in
reportb from runtime in reporta before calculating the efficiency
percentage. But if no downtime exists, the control that picksup the downtime
minutes from reportb reads "# error" and the percentage does not compute.

I have spent many hours trying to figure this out. Any help will be greatly
appreciated.
 
D

Duane Hookom

It would help if you provided the expression use are using to grab the
downtime minutes. Generically,
=IIf(sbrptCtrlB.Report.HasData, sbrptCtrlB.Report!txtTotalDowntime, 0)
 
W

wayne zabel

=IIf(IsNull([subfrm allowable dt within a run].[Form]![adtwar]),0,([subfrm
allowable dt within a run].[Form]![adtwar]))

This syntax works if the report named "subform allowable dt within a run"
exists, but errors out if the report does not exist. I tried you syntax
without luck.
 
D

Duane Hookom

First, I would not ever use a form as a subreport. Consider creating a
subreport. If your subreport control name is "subfrm allowable dt within a
run" then try:

=IIf([subfrm allowable dt within a run].[Form].HasData,[subfrm allowable dt
within a run].[Form]![adtwar],0)

--
Duane Hookom
MS Access MVP
--

wayne zabel said:
=IIf(IsNull([subfrm allowable dt within a
run].[Form]![adtwar]),0,([subfrm allowable dt within a
run].[Form]![adtwar]))

This syntax works if the report named "subform allowable dt within a run"
exists, but errors out if the report does not exist. I tried you syntax
without luck.
Duane Hookom said:
It would help if you provided the expression use are using to grab the
downtime minutes. Generically,
=IIf(sbrptCtrlB.Report.HasData, sbrptCtrlB.Report!txtTotalDowntime, 0)
 
W

wayne zabel

Duane
First I erred in naming my subreport what I did. After it was initially
working I was too lazy to rename it as subreport......
Secondly, I want to thank you for your help. The syntax now gives me
exactly what I was looking for.
Wayne
Duane Hookom said:
First, I would not ever use a form as a subreport. Consider creating a
subreport. If your subreport control name is "subfrm allowable dt within a
run" then try:

=IIf([subfrm allowable dt within a run].[Form].HasData,[subfrm allowable
dt within a run].[Form]![adtwar],0)

--
Duane Hookom
MS Access MVP
--

wayne zabel said:
=IIf(IsNull([subfrm allowable dt within a
run].[Form]![adtwar]),0,([subfrm allowable dt within a
run].[Form]![adtwar]))

This syntax works if the report named "subform allowable dt within a run"
exists, but errors out if the report does not exist. I tried you syntax
without luck.
Duane Hookom said:
It would help if you provided the expression use are using to grab the
downtime minutes. Generically,
=IIf(sbrptCtrlB.Report.HasData, sbrptCtrlB.Report!txtTotalDowntime, 0)

--
Duane Hookom
MS Access MVP
--

I have a report (reporta) which contains a subreport (reportb). Reporta
is a listing of all products run on a production line during a specified
period. Each record contains the qty manufactured, and a start time and
an end time. It calculates the total running time and compares the time
to make the actual production qty to an established standard and
calculates an efficiency percentage. All works fine so far. Now I want
to address downtime. I have a separate table with downtime events.
Reportb addresses the downtime events. I have linked the reports by ID
numbers and everything works for production runs with downtime. It
subtracts the downtime in reportb from runtime in reporta before
calculating the efficiency percentage. But if no downtime exists, the
control that picksup the downtime minutes from reportb reads "# error"
and the percentage does not compute.

I have spent many hours trying to figure this out. Any help will be
greatly appreciated.
 

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