Gustav Brock
Gustav at cactus.dk
Wed May 18 11:06:32 CDT 2005
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