parameters/drop down

  • Thread starter Thread starter klr397
  • Start date Start date
K

klr397

I have a report which has a paremters box which has you type in the name of
the customer and then it comes up with all the job orders that customer has
ever had with my company. however spelling seems tobe a major problem. Does
anyone know how or even if I could have a drop down list with the names of
all the companies instead of having to type it in?
 
I have a report which has a paremters box which has you type in the name of
the customer and then it comes up with all the job orders that customer has
ever had with my company. however spelling seems tobe a major problem. Does
anyone know how or even if I could have a drop down list with the names of
all the companies instead of having to type it in?

You cannot use a combo box directly in the query parameter, but you
can use a form and pass the combo value to the query.

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 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 (the query) [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 CompanyID.
Click the command button and then report will run.
When the report closes, it will close the form.
 
Back
Top