Results 1 to 2 of 2
  1. #1
    Join Date
    May 2013

    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.

  2. #2
    Join Date
    Nov 2012
    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:

    Option Explicit
    '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"
    End If
    DoCmd.OpenReport "NameOfYourReport", acViewReport, acEdit
    End Sub
    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.

    Hope this helps
    Last edited by Pis7ftw; 05-13-13 at 03:58.
    Version: Access 2010

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts