Display only a certain category in a report

B

bzeyger

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

John W. Vinson

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]
 
B

bzeyger

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

John W. Vinson

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.

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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top