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 / May 2008

Tip: Looking for answers? Try searching our database.

Using List/Combo Box to Obtain Parameter Information

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JWeaver - 21 May 2008 19:11 GMT
I want to be able to print reports that contain only 1 employee's
information.  I have set up a query with a parameter to pull this information
and it works but is there a way to set it up so that there is a list box or
combo box to choose the employee's name from instead of having to type it
each time?  Using a list would prevent names from being spelled incorrectly.

Any help you can give me would be appreciated!
Signature

JWeaver

Klatuu - 21 May 2008 20:40 GMT
In this case, the Combo box would be the preferred way to do it.
Create a combo that has two columns, the unique employee id (should ususally
be the primary key field for the employee table), and the employee name.

Now, here is the good part. You can use the combo to filter your report.
Don't put any filtering by employee in the report's record source query, do
it in the OpenReport method.  If the combo is set up as suggested, the combo
will return the primary key value for the selected employee.  You then use
that in the Where arguement of the OpenReport method:

Dim strWhere As String

   strWhere = "[EmployeeID] = " & Me.cboEmployee
   DoCmd.OpenReport "rptEmpReport", , , strWhere
Signature

Dave Hargis, Microsoft Access MVP

> I want to be able to print reports that contain only 1 employee's
> information.  I have set up a query with a parameter to pull this information
[quoted text clipped - 3 lines]
>
> Any help you can give me would be appreciated!
Tellu - 28 May 2008 08:15 GMT
I have the same problem. I´d like to ask where should I put the Combo box?
This seems to be a little bit difficult for me...
Signature

Thanks a lot!

Tellu

"Klatuu" kirjoitti:

> In this case, the Combo box would be the preferred way to do it.
> Create a combo that has two columns, the unique employee id (should ususally
[quoted text clipped - 18 lines]
> >
> > Any help you can give me would be appreciated!
Klatuu - 28 May 2008 14:32 GMT
The combo box should go on a form with the command button. First you select
an employee then click the command button to run the report.
Signature

Dave Hargis, Microsoft Access MVP

> I have the same problem. I´d like to ask where should I put the Combo box?
> This seems to be a little bit difficult for me...
[quoted text clipped - 20 lines]
> > >
> > > Any help you can give me would be appreciated!
 
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.