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
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