Printing Reports Via Checkboxes

P

Pommy_g

Hi, i have a number reports which will need printing by the user. But
not all of them will need printing at the same time. It is possible
that the user will just need to print 1 or 2 of the reports.

How can i set up checkboxes on a form which will allow the user to
select which reports he/she wants printing.

I am aware that i can just use buttons but i would prefer to make it a
bit more proffessional.


Thanks in advance.
 
H

HSalim

Pommy,
Try this:


Dim db As DataBase, rst As Recordset
Dim ssql As String, ssql2 As String
Set db = CurrentDb

ssql = ""

ssql = ssql & " SELECT ReportName from RTP where Print = True "

Set rst = db.OpenRecordset(ssql)

If Not (rst.EOF And rst.BOF) Then

msgbox "printing selected reports" ' these lines for testing

rst.MoveFirst
While Not rst.EOF
msgbox ("Printing: " & rst("reportName") ' these lines for testing
DoCmd.OpenReport rst("ReportName"), acViewNormal
rst.movenext
Wend
Else
msgbox "no reports selected for printing"
End if
 

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