[AccessD] Referencing Fields in Sub-Reports

Gustav Brock Gustav at cactus.dk
Wed May 18 12:37:24 CDT 2005


Hi Mark

Try replacing the last dots:

=IIf(Report!rptInvoiceDetail!rptInvoiceFlatRate.Report.RecordsetClone.RecordCount=0,
0,Report!rptInvoiceDetail!rptInvoiceFlatRate.Report!txtFlatRate) + 
IIf(Report!rptInvoiceDetail!rptInvoicePostage.Report.RecordsetClone.RecordCount=0,
0,Report!rptInvoiceDetail!rptInvoicePostage.Report!txtPostageAmt)

or just:

=IIf(rptInvoiceFlatRate.Report.RecordsetClone.RecordCount=0,
0,rptInvoiceFlatRate.Report!txtFlatRate) + 
IIf(rptInvoicePostage.Report.RecordsetClone.RecordCount=0,
0,rptInvoicePostage.Report!txtPostageAmt)

If still no success, this has to work:

=rptInvoiceFlatRate.Report.RecordsetClone.RecordCount

or, when records are present:

=rptInvoiceFlatRate.Report!txtFlatRate

/gustav


>>> MarkBoyd at McBeeAssociates.com 05/18 7:10 pm >>>
Gustav -
I use rptInvoiceFlatRate and rptInvoicePostage as both the subreport
names, and the subreport control names.
I changed the control names to InvoiceFlatRateSub and
InvoicePostageSub,
but still receive the "#Name?" display.
There are probably other ways to do this, but I feel like after
spending
a couple days on it, I don't want to start over.

Thanks again,
Mark Boyd
I/S Supervisor
McBee Associates, Inc.


-----Original Message-----
From: accessd-bounces at databaseadvisors.com 
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav
Brock
Sent: Wednesday, May 18, 2005 12:07 PM
To: accessd at databaseadvisors.com 
Subject: RE: [AccessD] Referencing Fields in Sub-Reports

Hi Mark

But aren't these 

rptInvoiceFlatRate and
rptInvoicePostage

the names of the subreports?
They be replaced with the names of the subreport controls in
rptInvoiceDetail.

/gustav

>>> MarkBoyd at McBeeAssociates.com 05/18 5:50 pm >>>
Main Report: rptInvoiceDetail
Sub1: rptInvoiceFlatRate
Sub2: rptInvoicePostage

When setting the control source of the main report's textbox to the
following, I'm prompted for a parameter value for the main report's
name.
"=IIf(Report!rptInvoiceDetail!rptInvoiceFlatRate.Report.RecordsetClone.R
ecordCount=0,0,Report!rptInvoiceDetail!rptInvoiceFlatRate.Report.txtFlat
Rate)+IIf(Report!rptInvoiceDetail!rptInvoicePostage.Report.RecordsetClon
e.RecordCount=0,0,Report!rptInvoiceDetail!rptInvoicePostage.Report.txtPo
stageAmt)".

If I remove the main reports name from the expression, the value
"#Name?" is displayed.

Mark Boyd
I/S Supervisor
McBee Associates, Inc.


-----Original Message-----
From: accessd-bounces at databaseadvisors.com 
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav
Brock
Sent: Wednesday, May 18, 2005 11:30 AM
To: accessd at databaseadvisors.com 
Subject: RE: [AccessD] Referencing Fields in Sub-Reports

Hi Mark

That sounds as if you have a misspelling.
What is the expression?

/gustav

>>> MarkBoyd at McBeeAssociates.com 05/18 5:24 pm >>>
Thanks Gustav.  
Logically, this looks like it should work.  Now, instead of "#Error",
the field is displaying "#Name?".

Mark Boyd
I/S Supervisor
McBee Associates, Inc.


-----Original Message-----
From: accessd-bounces at databaseadvisors.com 
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav
Brock
Sent: Wednesday, May 18, 2005 10:23 AM
To: accessd at databaseadvisors.com 
Subject: RE: [AccessD] Referencing Fields in Sub-Reports

Hi Mark

Your problem is that the control doesn't even "exist" when there are
no
records.
Thus, you may need something like this (one line):

  IIf(Report!rptMain!<sub1>.Report.RecordsetClone.RecordCount = 0, 0,
Report!rptMain!<sub1>.Report!txtTextbox) +
  IIf(Report!rptMain!<sub2>.Report.RecordsetClone.RecordCount = 0, 0,
Report!rptMain!<sub2>.Report!txtTextbox)

/gustav




More information about the AccessD mailing list