Suppress #Error

  • Thread starter chopper57 via AccessMonster.com
  • Start date
C

chopper57 via AccessMonster.com

I have a text box on a report. The box shows previous hours worked,
everything works fine once an employees time is entered, the very fist report
will show 0.0 hours as previous.

When no hours are entered, (and this could happen for the first few days when
a project starts) the previous box shows #Error. Is there a way to suppress
the error.

This is what I have in the text box:

=subrpt_AccumutiveHours.Report.AccumutiveTotal-_
IIf(subrpt_CalcHours.Report.HasData,_
Nz(subrpt_CalcHours.Report!HoursTotalSum,0),0)
 
M

Marshall Barton

chopper57 said:
I have a text box on a report. The box shows previous hours worked,
everything works fine once an employees time is entered, the very fist report
will show 0.0 hours as previous.

When no hours are entered, (and this could happen for the first few days when
a project starts) the previous box shows #Error. Is there a way to suppress
the error.

This is what I have in the text box:

=subrpt_AccumutiveHours.Report.AccumutiveTotal-_
IIf(subrpt_CalcHours.Report.HasData,_
Nz(subrpt_CalcHours.Report!HoursTotalSum,0),0)


Check the HasData property of subrpt_AccumutiveHours too.
 
D

Duane Hookom

If it is possible that subrpt_AccumutiveHours doesn't return any records,
you should use the same type of expression you used for the other subreport:
 
C

chopper57 via AccessMonster.com

This is what I ended up doing and it's working, I now have 0.00 when starting
new reports.

=IIf([subrpt_AccumutiveHours].[Report].[HasData],Nz([subrpt_AccumutiveHours].
[Report].[AccumutiveTotal],0),0)-IIf([subrpt_CalcHours].[Report].[HasData],Nz
([subrpt_CalcHours].[Report]![HoursTotalSum],0),0)

Thanks everyone for your help.

Duane said:
If it is possible that subrpt_AccumutiveHours doesn't return any records,
you should use the same type of expression you used for the other subreport:
I have a text box on a report. The box shows previous hours worked,
everything works fine once an employees time is entered, the very fist
[quoted text clipped - 12 lines]
IIf(subrpt_CalcHours.Report.HasData,_
Nz(subrpt_CalcHours.Report!HoursTotalSum,0),0)
 

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