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 / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

Display only a certain category in a report

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bzeyger - 14 Jan 2008 20:43 GMT
Hello,

I have a customer report I had made in Access VBA. I have a report header as
a project name with a bunch of tasks that are associated with it:

Example:

Project ABC:
            Employee1    Work    40 Hrs
            Employee2    Sleep    25 Hrs
            Employee3    Work    15 Hrs
            Employee4    Drive    3 Hrs

How can I get the report to only display the employees with WORK listed?
I did not want to change the query associated with the report.

Before the report would display, a dropdown box would appear, asking what
category the user would like to see.
John W. Vinson - 15 Jan 2008 17:21 GMT
>How can I get the report to only display the employees with WORK listed?
>I did not want to change the query associated with the report.
>
>Before the report would display, a dropdown box would appear, asking what
>category the user would like to see.

Use the AfterUpdate event of the combo box to launch the report, including a
"where condition" to select only the Work records.

One question though: do you want to display all of the categories for the
selected employees (just so long as at least one of them is "Work"), or do you
just want to display those records which contain Work as a category?

            John W. Vinson [MVP]
bzeyger - 15 Jan 2008 18:42 GMT
I wanted to display only the Work catagory. The user wold select an option
from a dropdown box prior to launching the report. The drop would hold the
task desired and the report should only display that task.

> >How can I get the report to only display the employees with WORK listed?
> >I did not want to change the query associated with the report.
[quoted text clipped - 10 lines]
>
>              John W. Vinson [MVP]
John W. Vinson - 15 Jan 2008 20:46 GMT
>I wanted to display only the Work catagory. The user wold select an option
>from a dropdown box prior to launching the report. The drop would hold the
[quoted text clipped - 14 lines]
>>
>>              John W. Vinson [MVP]

Use the AfterUpdate event of the combo box with code resembling:

Private Sub combobox_AfterUpdate()
If Not IsNull(Me!combobox) Then
  DoCmd.OpenReport "YourReportName", _
    WhereCondition:="[Category] = '" & Me!combobox & "'"
End If
End Sub

            John W. Vinson [MVP]
 
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



©2009 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.