B
Brook
Good Day,
I have a rptinvoice that I export to .snp format and right now I have field
invoicenumber added to the report name (see code below), but I would to also
add the invoicedate to the report name, but am getting a runtime error 2024.
Can anyone help me?
Begin Code:
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
End Code
Thanks,
Brook
I have a rptinvoice that I export to .snp format and right now I have field
invoicenumber added to the report name (see code below), but I would to also
add the invoicedate to the report name, but am getting a runtime error 2024.
Can anyone help me?
Begin Code:
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
End Code
Thanks,
Brook