Print one report for one record (1 Viewer)

M

Marleen Hart

Guest
I created a form with a control button which automatically prints a particular report.
My problem is that the correct report prints, but I get one report for each record in the table. I want only a single report for the one record which is the current record showing in the form.

Example: The form is for entry of registrants for a conference. The button prints a report which is a receipt for the one attendee who was just registered. Clicking the button on the form prints the correct receipt with correct attendee name and fees, etc. but I get one report for all the other attendees as well. Not good!

Please help me!
 
C

ConB

Guest
Try some code similar to this...

Private Sub cmdPrintDailyShiftProd_Click()
On Error GoTo Err_cmdPrintDailyShiftProd_Click

Dim stDocName As String

stDocName = "rptTotalShiftProduction"
DoCmd.OpenReport stDocName, acNormal

Exit_cmdPrintDailyShiftProd_Click:
Exit Sub

Err_cmdPrintDailyShiftProd_Click:
MsgBox Err.Description
Resume Exit_cmdPrintDailyShiftProd_Click

End Sub
 

Users who are viewing this thread

Top Bottom