Forum Discussion

PetarV's avatar
PetarV
Copper Contributor
Mar 01, 2021

Period of Time on a Report

Hello, I have a query that gives me totals based on Start and End date. Basically when I open the query a dialog box will open asking for Start and End date, then it gives me the results I need. My...
  • George_Hepworth's avatar
    Mar 02, 2021

    PetarV 

    The standard method most experienced Access developers use is to launch the query from a form. 

    On that form you place two text box controls: StartDate and EndDate. 

     

    In the query, change that criteria reference from the input boxes to the controls on the form:
    Between Forms!YourFormNameGoesHere.txtStartDate and Forms!YourFormNameGoesHere.TxtEndDate

     

    Now, the query is filtered on open by the values in those controls.

     

    And, your report can ALSO have two controls that reference those same form controls

    =Forms!YourFormNameGoesHere.txtStartDate

    and

    =Forms!YourFormNameGoesHere.TxtEndDate

     

     

Resources