C
cokeitis via AccessMonster.com
Hi there,
I would like to create a pdf file for my invoice using a combination of the
company name and invoice number. I would like to be able to preview the
invoice first, then save it and when it's saved the invoice would look
something like this: fakecompany-LPI02.
The code below is what I'm currently using to preview the invoice. I then
would select CUTEpdf Writer from my list of printers and save the file
manually.
If someone have a sample code I would really appreciate it as I have little
clue how to get this done. I've searched but haven't found one that I feel I
can tackle. Thanks in advance.
Private Sub cmdPrintInvoice_Click()
Dim strDocName As String
Dim strFilter As String
strDocName = "rptInvoice"
strFilter = "InvoiceNo = Forms!frmInvoice!InvoiceNo"
'Use this if you are sending report directly to printer
'DoCmd.OpenReport "rptInvoice", , , strFilter
'Use this if you are previewing report before printing
DoCmd.OpenReport "rptInvoice", acViewPreview, , strFilter
End Sub
I would like to create a pdf file for my invoice using a combination of the
company name and invoice number. I would like to be able to preview the
invoice first, then save it and when it's saved the invoice would look
something like this: fakecompany-LPI02.
The code below is what I'm currently using to preview the invoice. I then
would select CUTEpdf Writer from my list of printers and save the file
manually.
If someone have a sample code I would really appreciate it as I have little
clue how to get this done. I've searched but haven't found one that I feel I
can tackle. Thanks in advance.
Private Sub cmdPrintInvoice_Click()
Dim strDocName As String
Dim strFilter As String
strDocName = "rptInvoice"
strFilter = "InvoiceNo = Forms!frmInvoice!InvoiceNo"
'Use this if you are sending report directly to printer
'DoCmd.OpenReport "rptInvoice", , , strFilter
'Use this if you are previewing report before printing
DoCmd.OpenReport "rptInvoice", acViewPreview, , strFilter
End Sub