help with a text box

macri

Registered User.
Local time
Today, 02:32
Joined
Jul 7, 2011
Messages
22
hello and good day,

I have a report set up using date range perameters i can grab a quarter of data or a month or a day or a whole year worth of data. on this report i also want to display in a text box the following...

Code:
=([Main]![RD / QA Samples]+[Main]![Total Scrap]+[Main]![On Hold Lbs]+[Main]![Net Lbs])
this will show the actual net weight of pvc resin we're extruding - YAY RESIN! - and here is my SQL query that has the parameters and what not.

in access can you have more than one table selected in a query? also have this lookup chart working for our products that i want to use to auto fill descriptions and dimensions but that i already have working just not too sure how to add it all into the same report or if i can even still researching that one a bit.

here is the sql

Code:
PARAMETERS [First Date] DateTime, [Second Date] DateTime;
SELECT Main.[Mth/day], Main.[DS/NS], Main.Shift, Main.[Product Code], Main.[Product Description], Main.[Mat'l], Main.[Run Hrs], Main.Pcs, Main.Quantity, Main.[Total Run], Main.[RD / QA Samples], Main.[Total Scrap], Main.[On Hold Lbs], Main.[Net Lbs]
FROM Main
WHERE (((Main.[Mth/day]) Between [First Date] And [Second Date]));
 
Last edited:
It would appear that those fields are already in the record source of the report, so all you should need is a text box with a Control Source like;

=[RD/QA Samples] + [Total Scrap] + [On Hold Lbs] + [Net Lbs]
 
i've also tried doing it as a calcutlated field in a query but it just blanks out

Code:
Actual Net Weight: [Main].[RD / QA Samples]+[Main].[Total Scrap]+[Main].[Net Lbs]
 
also i just tried your method and it is now promting me after 1st date and 2nd date for RD/qa samples as an input /confused
 
Sounds like some of those fields are Null in some of the records. Try wrapping in the Nz function, either as a calculated query field or in the Control ource of a text box on your report;

Nz([RD/QA Samples],0) + Nz([Total Scrap],0) + Nz([On Hold Lbs],0) + Nz([Net Lbs],0)
 

Users who are viewing this thread

Back
Top Bottom