Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / March 2008

Tip: Looking for answers? Try searching our database.

Select Thing in Report

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Anthony - 13 Mar 2008 01:42 GMT
How can you set up when you run a report to only pick a certain information.  
I have a table that has a drop down menu of locations, I would like to run a
report and when you go to run it it asks you what location you would like to
pick.  If you could please reply when you get a chance.  Thanks.
fredg - 13 Mar 2008 02:03 GMT
> How can you set up when you run a report to only pick a certain information.  
> I have a table that has a drop down menu of locations, I would like to run a
> report and when you go to run it it asks you what location you would like to
> pick.  If you could please reply when you get a chance.  Thanks.

Let's assume you wish to filter the report so that only records
pertaining to a particular company are shown. Change the field names
as needed, but the process is the same.

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.
Set it's Bound column to 1.
Set it's Column Count property to 2.
Set the Column Width property to 0";1"
Name the Combo Box 'FindCompany'.

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

(Note: To write the code, in Form Design View select the command
button. Display the button's property sheet.
Click on the Event tab.
On the On Click line, write:

[Event Procedure]

Click on the little button with the 3 dots that appears on that line.
When the code window opens, the cursor will be flashing between 2
already existing lines of code.
Between those lines, write the following code.)

Me.Visible = False

Close the Code window.

Name this form 'ParamForm'.

In the Query that is the Report's Record Source [CompanyID] field
criteria line write:

forms!ParamForm!FindCompany

Next, code the Report's Open event:
(Using the same method as described above)

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

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.