darn #name?

  • Thread starter Thread starter mharness
  • Start date Start date
M

mharness

Hello All,

Can anyone see what's wrong with

=Reports!rptCampaignTD.rsubCampaignTD.Report.RecordSource.RecordCount

that it would return #name?

I've triple checked the names. Even broke down and used the expression
builder and I still get the #name?. I use this same approach on forms and
it works just fine. Is it not designed to work the same way on reports.

Thanks,

Mike
 
I'm amazed that this would work on a form, unless you were perhaps using
RecordSet instead of RecordSource.
Recordsource is a string property -
I can't see how it could be resolved to anything by appending RecordCount.
 
Hello MacDermott,

And amazed you should be because you are correct--what I use on the form is

Forms!frmCampaign.fsubCampaignMTD.Form.RecordsetClone.RecordCount

not RecordSource. Sorry about that.

So let's try this again. Is there not a report equivalent to the above
statement?

Thanks,

Mike
 
Actually, it's one of my few real problems with Access that reports don't
expose their Recordset or RecordsetClone properties. So no, there is no
exact equivalent for the technique you're using on your form.
However, if you'll check in Help under RunningSum, you may find
something you can make work to this purpose (counting the number of
records).
 
Hello MacDermott,

I couldn't necessarily find any solution with RunningSum but when I saw the
#error message it generated I thought try IsError and found my solution.

The problem has to do with two sub-reports on a report, each with their own
sub-totals that are then grand totaled on the main report. If there are no
records in either of the sub-reports (which happens) the missing sub-total
causes the grand total to fail. I tried IsNull, IsEmpty, and Nz but IsError
was the only one that worked.

Here's what the expression that works ended up looking like:

=IIf(Not
IsError(Reports!rptcampaigntd!rsubcampaignmtd!sumspotstd),Reports!rptcampaigntd!rsubcampaignmtd!sumspotstd,0)+IIf(Not
IsError(Reports!rptcampaigntd!rsubcampaigntd!sumspotstd),Reports!rptcampaigntd!rsubcampaigntd!sumspotstd,0)

Thanks for your help.

Mike
 
Back
Top