Printing Multiple Reports from drop downlist with one button

M

M.Garza

I hope someone can help me with this. I created a database that holds
employee productivity information for a call center. In a form, I have
a drop down list that reads the name from the "Emlpoyee Names" table
and two fileds for date entries (Start Date & End Date), depending on
the name and date range chosen, the report is generated and
displayed. It is all working fine but now the higher ups want to be
able to select one date range and print an individual report for each
employee. Can this be done? Any help is appreciated.
 
A

Al Campagna

M.Garza,
I'm sure there are more elegant solutions, but this is one "basic"
method. I think a common term for this method would be a report dialog
form.

Place two unbound fields... StartDate, and EndDate on an unbound form.
Instead of a dropdown list (combobox?) use a subform based on your
employees table, the query of which, looks to the form's StartDate and End
Date as it's criteria.
( Between Forms!frmYourFormName!StartDate And
Forms!frmYourFormName!EndDate )

Add a field to your table called PrintMe (Boolean/True/False), and place
it on the subform.

Your users can simply enter a Start and End date to filter the subform,
and from the remaining records, the user can select PrintMe for specific
individuals. (I usually build a button on subform that CheckAll, and
another that CheckNone to assist the user.)
The report query would use the Start and End Dates criteria from the
form, and the PrintMe = True criteria, to deliver only those records that
meet that criteria.

As I say, this is just one method of many...
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html
"Find a job that you love... and you'll never work a day in your life."
 
D

Duane Hookom

Can you print all employees on a single report with page breaks?

If you really need separate reports, you could use code that would loop
through the items in the combo box like:

Private Sub cmdLoopThroughCombo_Click()
Dim strWhere As String
Dim ctrCombo As ComboBox
Dim intI As Integer
Set ctrCombo = Me.cboEmployee
For intI = 0 To ctrCombo.ListCount - 1
DoCmd.OpenReport "rptNoName", acViewNormal, , _
"[EmployeeID]=" & ctrCombo.ItemData(intI)
Next
End Sub
 
M

M.Garza

M.Garza,
I'm sure there are more elegant solutions, but this is one "basic"
method. I think a common term for this method would be a report dialog
form.

Place two unbound fields... StartDate, and EndDate on an unbound form.
Instead of a dropdown list (combobox?) use a subform based on your
employees table, the query of which, looks to the form's StartDate and End
Date as it's criteria.
( Between Forms!frmYourFormName!StartDate And
Forms!frmYourFormName!EndDate )

Add a field to your table called PrintMe (Boolean/True/False), and place
it on the subform.

Your users can simply enter a Start and End date to filter the subform,
and from the remaining records, the user can select PrintMe for specific
individuals. (I usually build a button on subform that CheckAll, and
another that CheckNone to assist the user.)
The report query would use the Start and End Dates criteria from the
form, and the PrintMe = True criteria, to deliver only those records that
meet that criteria.

As I say, this is just one method of many...
--
hth
Al Campagna
Microsoft Access MVPhttp://home.comcast.net/~cccsolutions/index.html
"Find a job that you love... and you'll never work a day in your life."






- Show quoted text -

Thanks for the reply, I try this and let you know how it went. it
sounds like I can do it.

Thanks,
Maria
 
M

M.Garza

Can you print all employees on a single report with page breaks?

If you really need separate reports, you could use code that would loop
through the items in the combo box like:

Private Sub cmdLoopThroughCombo_Click()
Dim strWhere As String
Dim ctrCombo As ComboBox
Dim intI As Integer
Set ctrCombo = Me.cboEmployee
For intI = 0 To ctrCombo.ListCount - 1
DoCmd.OpenReport "rptNoName", acViewNormal, , _
"[EmployeeID]=" & ctrCombo.ItemData(intI)
Next
End Sub

--
Duane Hookom
Microsoft Access MVP



M.Garza said:
I hope someone can help me with this. I created a database that holds
employee productivity information for a call center. In a form, I have
a drop down list that reads the name from the "Emlpoyee Names" table
and two fileds for date entries (Start Date & End Date), depending on
the name and date range chosen, the report is generated and
displayed. It is all working fine but now the higher ups want to be
able to select one date range and print an individual report for each
employee. Can this be done? Any help is appreciated.- Hide quoted text -

- Show quoted text -

It is ok to have all in one report with page breaks, as long as I get
all employees on individual report for the date range selected. I'll
try your code and the other suggestion and let you know on Monday.

Thank you so much for your assistance.
Maria
 
M

M.Garza

Can you print all employees on a single report with page breaks?
If you really need separate reports, you could use code that would loop
through the items in the combo box like:
Private Sub cmdLoopThroughCombo_Click()
Dim strWhere As String
Dim ctrCombo As ComboBox
Dim intI As Integer
Set ctrCombo = Me.cboEmployee
For intI = 0 To ctrCombo.ListCount - 1
DoCmd.OpenReport "rptNoName", acViewNormal, , _
"[EmployeeID]=" & ctrCombo.ItemData(intI)
Next
End Sub
- Show quoted text -

It is ok to have all in one report with page breaks, as long as I get
all employees on individual report for the date range selected. I'll
try your code and the other suggestion and let you know on Monday.

Thank you so much for your assistance.
Maria- Hide quoted text -

- Show quoted text -

Hello, I tried both solutions and both worked very well, I've decided
to use the code since I already had the Start Date and End Date fields
that also work for several other reports that I have. Thank you again
for your help!!!

Maria
 

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