Unanswered: Creating Summary Report Filtered By Dates
Hi to all,
I am working on microsoft access report, and I would like to make a summarization report based from dates (comparing "from" and "now"). It means, I want to compare the two dates and count how many data can be generated by the given filters.
Thanks! Any helpful reply will much be appreciated.
Create a simple form for two text box controls. Name them txtBeginDate and txtEndDate.
Create a button, name it cmdCompile, open up a VBA module, type the following:
'This procedure checks to see if the form with which you enter data
'is open, and if it is, closes it, then opens your report and filters the results
'through the date criteria between the two text boxes on this form
Private Sub cmdCompile_Click()
If CurrentProject.AllForms("NameOfFormYouEnterDataFrom").IsLoaded Then
DoCmd.Close acForm, "NameOfFormYouEnterDataFrom"
DoCmd.OpenReport "NameOfYourReport", acViewReport, acEdit
Save and name the form frm_ReportComp_ByDate (you can name it whatever you want but for simplicity and identification sake name it this.
In the query behind the report I assume you have a date field. While in detail view of the query in the criteria field enter the following:
Between [Forms]![frm_ReportComp_ByDate]![txtBeginDate] And [Forms![frm_ReportComp_ByDate]![txtEndDate]
This tells the query to search for the dates in frm_ReportComp_ByDate between txtBeginDate and txtEndDate.
If you were to manually open the report from the navigation bar it would prompt you to enter the dates for txtBeginDate and txtEndDate without having to use the form.