Creating a form to supply parameters to a report

F

Fie

Hi am so confused on how to do this av been told so many ways and to be
honest am lost.
What am trying to do is

Open a report called rptBooks, attached to this report is a form
(frmDates) that serves to collect parameters. StartDate & EndDate, You
enter the parameters and click OK.
Access then processes the report's underlying query (qryBooks). That
query retrieves parameters from the controls on the form then delivers
its results to the report.

Iam using Access 97, i have found an example but it just works with
2003, the module code doesnt work for 97.

can anyone help a confused Access users :-((

fiona
 
F

fredg

Hi am so confused on how to do this av been told so many ways and to be
honest am lost.
What am trying to do is

Open a report called rptBooks, attached to this report is a form
(frmDates) that serves to collect parameters. StartDate & EndDate, You
enter the parameters and click OK.
Access then processes the report's underlying query (qryBooks). That
query retrieves parameters from the controls on the form then delivers
its results to the report.

Iam using Access 97, i have found an example but it just works with
2003, the module code doesnt work for 97.

can anyone help a confused Access users :-((

fiona

Create an unbound form.

Add 2 unbound text controls.
Set their format to a valid date format.
Name them "StartDate" and "EndDate"

Add a Command Button to the form.
Code the button's click event:

Me.Visible = False

Name this form 'ParamForm'.

As criteria in the query date field write:
Between forms!Paramform!StartDate and forms!ParamForm!EndDate

Next, code the report's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog

Code the report's Close event:
DoCmd.Close acForm, "ParamForm"

When ready to run the report, open the report.
The form will open and wait for the entry of the starting and ending
dates wanted.
Click the command button and then report will run.
When the report closes, it will close the form.
 

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