print records selected in REPORT

_Brian_

Registered User.
Local time
Today, 22:18
Joined
Nov 26, 2004
Messages
29
I need print records selected in a REPORT, of continuos forms. this is example

form.JPG



please help me!!! :confused: :confused:
 
Create your report then add the following code to the 'PRINT REPORT' button's on click event :


Private Sub cmdPrintReport_Click()
On Error GoTo Err_cmdPrintReport_Click

Dim stDocName As String

stDocName = "rpt_yourReportName"
DoCmd.OpenReport stDocName, acPreview
With Reports(stDocName)
.Filter = Me.Filter
.FilterOn = True
End With

Exit_cmdPrintReport_Click:
Exit Sub

Err_cmdPrintReport_Click:
MsgBox Err.Description
Resume Exit_cmdPrintReport_Click

End Sub


Hope it helps :)
 
the button not apply this filter...i need print the records selected in form.
 
Hello Brian!
Look at "DemoContinousA2000.mdb",
Dbl Click on OrderID field, in field fPrint will appear "*",
click on command buton "Preview Report".
I think it is what you need.
 

Attachments

Expanding on the Demo database you can also enter an event on the Form Onclick event so that users do not have to double click on the record. Note that I have changed the * to Y so that users know they are going to print that record. I have attached a modified working demo.
 

Attachments

Users who are viewing this thread

Back
Top Bottom