Export to Snapshot Custom Report Name Help

B

Brook

Good Day All,

I have a report that I currently export to .snp format from my form, and
it contains a field from my form within the report name. I am trying to add a
second field from my invoice form to my Report Name, but am getting an error.
Can anyone assist me?

Below is my current code and also the field I would like to add:

Private Sub cmdprintinvoice_Click()
Dim strReportName As String
Dim strcriteria As String

If NewRecord Then
MsgBox "This record contains no data. Please select a record to
print or Save this record." _
, vbInformation, "Invalid Action"
Exit Sub
Else
strReportName = "rptinvoices"
strcriteria = "[invoiceid]= " & Me![invoiceid]


DoCmd.OpenReport strReportName, acViewPreview, , strcriteria


If MsgBox("Do you want to save the report to disk?", vbYesNo +
vbQuestion, "Save Report") = vbYes Then

strOutputName = "D:\Karma Imports\Invoices\" & (Me!invoicenumber) &
" - " & Format(Date, "mm_dd_yyyy") & ".snp"



DoCmd.OutputTo acOutputReport, strReportName, acFormatSNP,
strOutputName, True
End If


End If
End Sub

I would like to add the field "invoicedate" to the report name. How do I do
that?

Thanks,

Brook
 

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