Using Form for Criteria for Report

  • Thread starter Thread starter Basenji
  • Start date Start date
B

Basenji

Using Access 2003 I have created a form with two text boxes to enter start
and end dates for the criteria for a report. The report is made up of
subreports that have no connection. The reports were inserted into a blank
report. I would like for the criteria, the start and end date, that is
entered in the form to return the data for all of the subreports without
having to enter the same criteria, start and end dates, for each report when
the parameter is part of each query. So far when I enter the dates it returns
data outside of the date range. So in my header where I have controls to show
the date range it shows the date range that has been entered, but in the
records that are returned there are dates outside of the dates entered in the
criteria. Is it possible to do this? If so, what do you suggest?
Thank you.
 
You can add references to the form's controls for the record source for each
sub report and the main report:

WHERE [StartDate] BETWEEN Forms!MyForm!txtStartDate AND
Forms!MyForm!txtEndDate
 
Right now the record source for the report is a query. So to make sure I
understand, the record soruce for the report should take the form you are
suggesting?

Klatuu said:
You can add references to the form's controls for the record source for each
sub report and the main report:

WHERE [StartDate] BETWEEN Forms!MyForm!txtStartDate AND
Forms!MyForm!txtEndDate
--
Dave Hargis, Microsoft Access MVP


Basenji said:
Using Access 2003 I have created a form with two text boxes to enter start
and end dates for the criteria for a report. The report is made up of
subreports that have no connection. The reports were inserted into a blank
report. I would like for the criteria, the start and end date, that is
entered in the form to return the data for all of the subreports without
having to enter the same criteria, start and end dates, for each report when
the parameter is part of each query. So far when I enter the dates it returns
data outside of the date range. So in my header where I have controls to show
the date range it shows the date range that has been entered, but in the
records that are returned there are dates outside of the dates entered in the
criteria. Is it possible to do this? If so, what do you suggest?
Thank you.
 
It should be part of your query.
--
Dave Hargis, Microsoft Access MVP


Basenji said:
Right now the record source for the report is a query. So to make sure I
understand, the record soruce for the report should take the form you are
suggesting?

Klatuu said:
You can add references to the form's controls for the record source for each
sub report and the main report:

WHERE [StartDate] BETWEEN Forms!MyForm!txtStartDate AND
Forms!MyForm!txtEndDate
--
Dave Hargis, Microsoft Access MVP


Basenji said:
Using Access 2003 I have created a form with two text boxes to enter start
and end dates for the criteria for a report. The report is made up of
subreports that have no connection. The reports were inserted into a blank
report. I would like for the criteria, the start and end date, that is
entered in the form to return the data for all of the subreports without
having to enter the same criteria, start and end dates, for each report when
the parameter is part of each query. So far when I enter the dates it returns
data outside of the date range. So in my header where I have controls to show
the date range it shows the date range that has been entered, but in the
records that are returned there are dates outside of the dates entered in the
criteria. Is it possible to do this? If so, what do you suggest?
Thank you.
 
Back
Top