I have created a database along with forms and report and have created a
switchboard for it. One of the selections I have on my switchboard is called
DHR Report. This button opens up a report to print. Once you click on the
DHR Report button I would like a pop up box to appear asking for a specific
record number. How would I do this? Any help would be truly appreciated.
Thanks,
Teri.
Several ways.
Access records do not have actual Record Numbers, so perhaps you mean
some other record identifying value.
Let's assume you meant a specific company.
You can adapt this however you want.
You could do this from the Open Event of the report.
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'.
Create a query to be used as the report's record source.
In the Query's [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 wanted.
Click the command button and then report will run.
When the report closes, it will close the form.