Retrieving data from a query and making a calculation in a form

mailman26

New member
Local time
Today, 11:04
Joined
Mar 13, 2012
Messages
8
Hi,

I'm new at VBA and Access.
I'm working on a db that will keep track of production in a warehouse. I want to calculate the total yield of product we get given a specific date range.

I created a query to retrieve data that I need to make the calculation:

SELECT tbl_Stageing.Production_Date, tbl_Stageing.Stage_ID, tbl_Stageing.Product_Condition, tbl_Stageing.Product_Category, tbl_Stageing.Product_Weight_perc
FROM tbl_Stageing
WHERE (((tbl_Stageing.Production_Date) Between [Start Date] And [End Date]) AND ((tbl_Stageing.Stage_ID)=[Stage ID]) AND ((tbl_Stageing.Product_Condition)=[Condition]) AND ((tbl_Stageing.Product_Category)=[Category]));




I want to make a calculation of total yield given a date range using this data in a form.
Any ideas or suggestions on how I can go about doing this?

Thanks!

Kumail
 
Hello Kumail,

Do you mean you want is nothing but the total of the above query result?

If that is the case, then the answer is simple. Just save this query as something and then. Create another Query using the wizard.

Create-->QueryWizard-->SimpleQueryWizard-->(select the query you just saved)-->(select all the fields)-->(it will ask you now if you want a detail/summary)Choose summary--> Click Summary options-->Check the Sum-->Finish.
 

Users who are viewing this thread

Back
Top Bottom