Mark Boyd
MarkBoyd at McBeeAssociates.com
Wed May 18 15:34:56 CDT 2005
For some reason, this isn't working either ... still displaying "#Name?". There must be something wrong with how I'm naming objects. I tried using A.D. Tejpal's example, and came up with a successful expression: "=IIf(InvoiceFlatRateSub.Report.HasData,InvoiceFlatRateSub.Report.txtFla tRate,0)+IIf(InvoicePostageSub.Report.HasData,InvoicePostageSub.Report.t xtPostageAmt,0)" Thanks Gustav and A.J., I greatly appreciate your help. Mark Boyd I/S Supervisor McBee Associates, Inc. 610/964-9680 x15 -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Wednesday, May 18, 2005 1:37 PM To: accessd at databaseadvisors.com Subject: RE: [AccessD] Referencing Fields in Sub-Reports Hi Mark Try replacing the last dots: =IIf(Report!rptInvoiceDetail!rptInvoiceFlatRate.Report.RecordsetClone.Re cordCount=0, 0,Report!rptInvoiceDetail!rptInvoiceFlatRate.Report!txtFlatRate) + IIf(Report!rptInvoiceDetail!rptInvoicePostage.Report.RecordsetClone.Reco rdCount=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 -- 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. -------------------------------------------