Combo Box

  • Thread starter Thread starter bill
  • Start date Start date
B

bill

Can anyone explain in simple terms how I can make a query -
which feeds into a report by the way, give me a combo box
so I can pick from this drop list the value I want to use
in the paremeter query? I am a novice so I would
appreciate it if you kept this in mind with any responses.
 
bill said:
Can anyone explain in simple terms how I can make a query -
which feeds into a report by the way, give me a combo box
so I can pick from this drop list the value I want to use
in the paremeter query? I am a novice so I would
appreciate it if you kept this in mind with any responses.

Bill,
The following uses a Combo Box to find a CompnayID field to limit
records returned by the query.
You can adapt this to any other field.

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'.

As parameter in the query, write, on the CompanyID criteria line:
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.
Click the command button and then report will run.
When the report closes, it will close the form.
 
Back
Top