Subreport - No record creates #Error

C

Cuda

Here's my simple code which works fine as long as there's records.

=[Change Orders subreport1].[Report]![Sum CO Amount]
this calculates the total perfectly as long as there's
a record ;)

I've tried the following codes
=IIF([Change Orders
subreport1].[Report]![RecordsetClone].[RecordCount]>0,[Change Orders
subreport1].[Report]![Sum CO Amount],0)
this gives me the #Name? error so I must have a typo.

=IIF([Change Orders subreport1].[Report]![Sum CO Amount]HasData, [Change
Orders subreport1].[Report]![Sum CO Amount],0)
invalid syntax
 
K

Ken Snell MVP

This is example of the expression that I use in such situations:

=IIf([srptBegBal].[Report].[HasData]=True,[srptBegBal].[Report]![BegBal],0)

so for you, try this:


=IIf([Change Orders subreport1].[Report].[HasData]=True,[Change Orders
subreport1].[Report]![Sum CO Amount],0)
 
K

Ken Snell MVP

This is example of the expression that I use in such situations:

=IIf([srptBegBal].[Report].[HasData]=True,[srptBegBal].[Report]![BegBal],0)

so for you, try this:


=IIf([Change Orders subreport1].[Report].[HasData]=True,[Change Orders
subreport1].[Report]![Sum CO Amount],0)
 
C

Cuda

Thanks! That did the trick. I had to re-enter the brackets around HasData
twice before they actually stayed, but now it's working like a charm.

Ken Snell MVP said:
This is example of the expression that I use in such situations:

=IIf([srptBegBal].[Report].[HasData]=True,[srptBegBal].[Report]![BegBal],0)

so for you, try this:


=IIf([Change Orders subreport1].[Report].[HasData]=True,[Change Orders
subreport1].[Report]![Sum CO Amount],0)

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/



Cuda said:
Here's my simple code which works fine as long as there's records.

=[Change Orders subreport1].[Report]![Sum CO Amount]
this calculates the total perfectly as long as
there's
a record ;)

I've tried the following codes
=IIF([Change Orders
subreport1].[Report]![RecordsetClone].[RecordCount]>0,[Change Orders
subreport1].[Report]![Sum CO Amount],0)
this gives me the #Name? error so I must have a
typo.

=IIF([Change Orders subreport1].[Report]![Sum CO Amount]HasData, [Change
Orders subreport1].[Report]![Sum CO Amount],0)
invalid syntax
 
C

Cuda

Thanks! That did the trick. I had to re-enter the brackets around HasData
twice before they actually stayed, but now it's working like a charm.

Ken Snell MVP said:
This is example of the expression that I use in such situations:

=IIf([srptBegBal].[Report].[HasData]=True,[srptBegBal].[Report]![BegBal],0)

so for you, try this:


=IIf([Change Orders subreport1].[Report].[HasData]=True,[Change Orders
subreport1].[Report]![Sum CO Amount],0)

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/



Cuda said:
Here's my simple code which works fine as long as there's records.

=[Change Orders subreport1].[Report]![Sum CO Amount]
this calculates the total perfectly as long as
there's
a record ;)

I've tried the following codes
=IIF([Change Orders
subreport1].[Report]![RecordsetClone].[RecordCount]>0,[Change Orders
subreport1].[Report]![Sum CO Amount],0)
this gives me the #Name? error so I must have a
typo.

=IIF([Change Orders subreport1].[Report]![Sum CO Amount]HasData, [Change
Orders subreport1].[Report]![Sum CO Amount],0)
invalid syntax
 

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