Report based on a Date Form

  • Thread starter artist02 via AccessMonster.com
  • Start date
A

artist02 via AccessMonster.com

Hello, guys I urgently need your help to create a report.

I have an unbound report called "test" which has some of these
text boxes: i) txtE1 ii) txtProduction. The controlsource of the txtboxes is
like this and
works perfectly:
=Nz(DLookUp("[SumOfDowntime]","qryDowntime","[Downtime_Code] = '" & 3 & "'AND
[Machine]= '" & 1_ & "'"),0)

1. How can i create a form where a user can input a date and the DLookUp
above creates the
correct info for that particular date on the report.
2. How can i create a DLookUp on the controlsource of txtProduction based on
qryTotal_Production
where it presents [SumOfScrap_Kgs] from qryTotal_Production where
[Scrap Date] = to the the date entered by a user on the form created above.



These are the 2 queries that i have: qryTotal_Production and
qryDowntime:

qryDowntime:

SELECT qryDowntimeUnion.Session, qryDowntimeUnion.Machine,
qryDowntimeUnion.Shift, qryDowntimeUnion.Downtime_Code,
Sum(qryDowntimeUnion.Downtime) AS SumOfDowntime,
Format([Date],"dd-mmm-yyyy") AS [Downtime Date]
FROM qryDowntimeUnion
GROUP BY qryDowntimeUnion.Session, qryDowntimeUnion.Machine,
qryDowntimeUnion.Shift, qryDowntimeUnion.Downtime_Code,
Format([Date],"dd-mmm-yyyy")
HAVING (((qryDowntimeUnion.Downtime_Code) Is Not Null) AND
((Sum(qryDowntimeUnion.Downtime)) Not Like "0"));

qryTotal_Production:

SELECT qryScrapUnion.Session, qryScrapUnion.Machine,
qryScrapUnion.Shift, Sum(qryScrapUnion.Scrap_Kgs) AS SumOfScrap_Kgs,
Format([Date],"dd-mmm-yyyy") AS [Scrap Date]
FROM qryScrapUnion
GROUP BY qryScrapUnion.Session, qryScrapUnion.Machine,
qryScrapUnion.Shift, Format([Date],"dd-mmm-yyyy")
HAVING (((Sum(qryScrapUnion.Scrap_Kgs)) Not Like "0"));


Thank you in advance!

PS. Iam an access 2002 novice.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top