Subreport - No record creates #Error

  • Thread starter Thread starter Cuda
  • Start date Start date
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
 
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)
 
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)
 
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
 
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
 
Back
Top