Using Parameter queries with reports

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Using Access 2003
Am a designing a database containing all jobs we have done for clients. Have
set up a parameter query so one can search the database for work done by a
particular client. The parameter query is set up as a form, so the client
name can be selected from a drop-down box. I then created a report based on
this form, so ideally when a client is selected using the form, all jobs for
that client appear in a report. however when the report is run it always
comes out blank. Any ideas as to why this is happening???
 
Using Access 2003
Am a designing a database containing all jobs we have done for clients. Have
set up a parameter query so one can search the database for work done by a
particular client. The parameter query is set up as a form, so the client
name can be selected from a drop-down box. I then created a report based on
this form, so ideally when a client is selected using the form, all jobs for
that client appear in a report. however when the report is run it always
comes out blank. Any ideas as to why this is happening???

Try it this way.
You can adapt whatever you already have.

Create an unbound form.
Add a combo box.
Set the Row Source of the combo box to include the
CompanyID field and the Company Name.
Name the Combo Box 'FindCompany'.
Set it's Bound column to 1.
Set it's Column Count property to 2.
Set the Column Width property to 0";1"

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

Me.Visible = False

Name this form 'ParamForm'.

In the Report's Record Source [CompanyID] field criteria line write:
forms!ParamForm!FindCompany

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 selection of the Company and 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.
 
Back
Top