Senin, 26 September 2011

RE: [MS_AccessPros] Report not displaying "0.00" from a null subreport

 

Thank you Clive, I've taken your suggestion under consideration and have
made the changes. After looking at it myself, it looked confusing.

r/David

From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Duane Hookom
Sent: Monday, September 26, 2011 10:25 AM
To: Access Professionals Yahoo Group
Subject: RE: [MS_AccessPros] Report not displaying "0.00" from a null
subreport

Thanks John.

David, You might consider a naming convention that doesn't allow symbols
like "-" and doesn't have "frm" in a report name. Old guys like me find this
very confusing ;-)

Duane Hookom
MS Access MVP

From: john@viescas.com <mailto:john%40viescas.com>

Clive-

He has to test HasData because if there are no rows, then the control
txtPartsTotal doesn't exist.

John Viescas, author

-----Original Message-----
[mailto:MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com> ] On Behalf Of Clive

Hi David,

Change
=Nz([frmParts-RepairOrder subreport].[Report]![txtPartsTotal])
To
=Nz([frmParts-RepairOrder subreport].[Report]![txtPartsTotal],0)
Or maybe use a text string
=Nz([frmParts-RepairOrder subreport].[Report]![txtPartsTotal],"0.00")

The value after the comma is the value returned for a zero.

Regards, Clive.

--- In MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com> , "David Tolson"
<drtolson@...>
wrote:
>
> Thank you John, the control source currently has this.
>
> =Nz([frmParts-RepairOrder subreport].[Report]![txtPartsTotal])
>
> Which I thought would place a zero in the field if there was no data in
> "txtPartsTotal." I changed the control source to read.
>
> =IIF(frmParts-RepairOrder subreport.Report.HasData, [frmParts-RepairOrder
> subreport].[Report]![txtPartsTotal], 0)
>
> And I am getting the following error.
>
> The expression you entered contains invalid syntax. You may have entered
an
> operand without an operator.
>
> FYI, the field that is giving me the error is in the parent report and the
> subreport that has no data does not even display. I'm not sure if that
makes
> a different in the way the control source is laid out.
>
> David
>
> [mailto:MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com> ] On Behalf Of John
Viescas
>
> David-
>
> PMJI - put that IIF expression in the Control Source of the control where
> you're
> getting the error.
>
> John Viescas, author
>
> -----Original Message-----
> <mailto:MS_Access_Professionals%40yahoogroups.com> ] On Behalf Of David
> Tolson
>
> Thanks Duane, I've been out of town and didn't have access to my email, so
> I'm just getting my feet back on the ground. I have looked for the
"HasData"
> property of the subreport, but haven't been able to find it, and I do not
> know where to put your suggested code. I tried placing it in the subform's
> On Load event and received a compile error.
>
> r/David
>
> -----Original Message-----
> <mailto:MS_Access_Professionals%40yahoogroups.com> ] On Behalf Of Duane
> Hookom
>
> David,
> You can take advantage of the HasData property of the subreport. Mix this
> with IIf() to get your total or 0 like (caution "air" expression):
>
> =IIf(srptParts.Report.HasData, srptParts.Report.txtTotParts, 0)
>
> Duane Hookom
> MS Access MVP
>
> From: drtolson@... <mailto:drtolson%40verizon.net>
>
> Great Day, I have a report that is printing an invoice for services
> performed on a vehicle at a automobile repair shop. the report loads
> customer and vehicle data, along with totals from two subreports: one
shows
> the work that was done on a vehicle - oil change, replace front brakes
pads,
> etc; and the other one shows the parts that were needed for the job - oil,
> oil filter, air filter, etc. In one report no parts were used, so that
> subreport does not print, and the total fields in the parent report:
"Total
> Parts", "Total Tax," and "Total Repair" all display "#Error".
>
> I suspect that these errors are the result of no data in the parts
> subreport; however, the "Total Parts", Total Tax", and "Total Repair,"
> fields all have the Nz(Field name) function, which I thought would produce
> 0.00 if that parts field was null.
>
> Thanks in advance for your assistance.

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar