From: Dennis on 5 Apr 2010 14:14 Marshall, That finally worked!!!!!!! I do have a couple of questions. 1. What is the difference between: =rptInvoice_srDet.Report!txtTotal or, as I prefer: =rptInvoice_srDet.Report.Report.txtTotal I see the second has Report.Report in it where the first one has just Report once. What is the advantage of Report.Report? 2. Not that that part works, I want to have two totals. The first is for Labor The second is for Parts In my grand total, I then add the two numbers together. I can tell if the invoice line is a part if TransCat = "P". If the invoice line is for labor, TransCat = "L". I tried this in the subreport's footing section: =IIf([TransCat]="P",Sum([Quantity]*[Price]),0) and all I got was a zero. the amount shoud have been about $24. Dennis
From: Marshall Barton on 5 Apr 2010 16:13 Dennis wrote: >That finally worked!!!!!!! > >I do have a couple of questions. > >1. What is the difference between: >=rptInvoice_srDet.Report!txtTotal >or, as I prefer: >=rptInvoice_srDet.Report.Report.txtTotal Man, did I mess that up. It should have been: =rptInvoice_srDet!txtTotal Or, as I prefer: =rptInvoice_srDet.Report.txtTotal Access resolves the ! syntax at runtime by trying a couple of possible meanings. Because txtTotal is not part of the subreport control, Access has to dig around to try to resolve the name as part of the subreport's controls collection. The .Report syntax can be resolved (and error checked) at design time. > >I see the second has Report.Report in it where the first one has just Report >once. What is the advantage of Report.Report? None, it was a brain fault :-( The point was the .Report instead of ! > >2. Not that that part works, I want to have two totals. >The first is for Labor >The second is for Parts >In my grand total, I then add the two numbers together. > >I can tell if the invoice line is a part if TransCat = "P". If the invoice >line is for labor, TransCat = "L". > >I tried this in the subreport's footing section: >=IIf([TransCat]="P",Sum([Quantity]*[Price]),0) Try it this way: =Sum(IIf([TransCat]="P", [Quantity]*[Price], 0)) -- Marsh MVP [MS Access]
From: Dennis on 6 Apr 2010 02:09 Marshall, Thanks, I got me invoice "report" working just the way I wanted. Your comment: Try it this way: =Sum(IIf([TransCat]="P", [Quantity]*[Price], 0)) That worked great!!! Now that I see it, I feel kind of dumb. Oh well, but I learned a lot. Thanks so much for your assitance. Dennis
From: Marshall Barton on 6 Apr 2010 11:06 Dennis wrote: >Thanks, I got me invoice "report" working just the way I wanted. > >Your comment: Try it this way: > =Sum(IIf([TransCat]="P", [Quantity]*[Price], 0)) > >That worked great!!! Now that I see it, I feel kind of dumb. Oh well, but >I learned a lot. > >Thanks so much for your assitance. Your welcome. Waxing philosophical ;-) Don't feel bad about not knowing something. Ignorance should be overcome, feeling "dumb" or frustrated just gets in the way. It's so much more fun to learn new things than to just sit there fuming. -- Marsh MVP [MS Access]
From: Dennis on 7 Apr 2010 14:39
Marsh, Thanks for the encouragement. It much more fun to learn new things. I'm having so much "fun" climbing the Access learning cliff. :-) Dennis |