[AccessD] Referencing Fields in Sub-Reports

Mark Boyd MarkBoyd at McBeeAssociates.com
Wed May 18 12:10:29 CDT 2005


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

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
 
-----------------------------------------
This message and any attachments are intended only for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential, and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender by replying to this message, and then delete it from your system.
-------------------------------------------



More information about the AccessD mailing list