Print one report from a form.

  • Thread starter Thread starter Sailor
  • Start date Start date
S

Sailor

I have created a trouble call log, in it I have a
Supervisor's section where the Sups monitor and distribute
the trouble calls they receive. In addition they are
able to print the trouble calls if needed but it prints
all the trouble calls. What I am trying to do is allow
them to print only one trouble call vice all. As it
stands when they go to print there trouble calls it prints
all of them. Is there a way with the use of button to
print just one record and not all of them?

Thanks for your help.

Below is what I currently have on the form:

Private Sub Command12_Click()
On Error GoTo Err_Command12_Click

Dim stDocName As String

stDocName = "rpt_ADPPrintOneAtTime"
DoCmd.OpenReport stDocName, acPreview

Exit_Command12_Click:
Exit Sub

Err_Command12_Click:
MsgBox Err.Description
Resume Exit_Command12_Click

End Sub
 
in the DoCMD.OpenReport "reportname"
comma (,) out until you get to the end where you can enter
a string for a WHERE clause. Here you can specify the
TroubleTicketID value ("TroubleTicketID = " & clng
(txtTicketNumber)"
 
Rob,

Thanks for your help, but I am lacking in the code dept.
Can you show me what you are talking about with the script
I have provided?

Private Sub Command12_Click()
On Error GoTo Err_Command12_Click

Dim stDocName As String

stDocName = "rpt_ADPPrintOneAtTime"
DoCmd.OpenReport stDocName, acPreview

Exit_Command12_Click:
Exit Sub

Err_Command12_Click:
MsgBox Err.Description
Resume Exit_Command12_Click

End Sub


Thanks.
 
Sure...
Private Sub Command12_Click()
On Error GoTo Err_Command12_Click

Dim stDocName As String

stDocName = "rpt_ADPPrintOneAtTime"
DoCmd.OpenReport stDocName, acPreview,,"TICKET = " &
txtTicket

Exit_Command12_Click:
Exit Sub

Err_Command12_Click:
MsgBox Err.Description
Resume Exit_Command12_Click

End Sub
*** So as you can see I added two commas (,) and then
criteria for the report (I assume each trouble ticket has
a unique ID and that the user can select a unique ID.)

If you need more assistance, please email me at rwaibel at
ILXResorts dot com
 
Back
Top