Switchboard Drop down menus

message from =?Utf-8?B?QW15?= on 10 May 2004
I have a report that runs in a Switchboard. I need to have a dropdown menu appear before the report runs to pick a parameter. I have a seperate table with the items that need to go into the dropdown. Please help.
 
fredg replied to =?Utf-8?B?QW15?= on 10 May 2004
The following will use a combo box to find a particular company.
Adapt it for whatever you need.

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 Company.
Click the form command button and then report will run.
When the report closes, it will close the form.
 

Archived message: Switchboard Drop down menus (MS Access Forms)