B
Brook
Hello All,
I am getting this error when I am trying to OutPutto my report:
Microsoft Office Access can't save the output data to the file you've
selected.
here is my command button code:
Begin Code:
Private Sub cmdPrintPreview_Click()
Dim strReportName As String
Dim strCriteria As String
Dim strOutputName 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 = "rptcustomorders"
strCriteria = "[orderid]= " & Me![orderid]
DoCmd.OpenReport strReportName, acViewPreview, , strCriteria
If MsgBox("Do you want to save the report to disk?", vbYesNo +
vbQuestion, "Save Report") = vbYes Then
strOutputName = DLookup("[OrdNum]", "qryinventory") & " - " &
Format(Date, "dd/mm/yyyy")
DoCmd.OutputTo acOutputReport, strReportName, "Rich Text Format",
strOutputName, True
End If
End If
End Sub
End Code
I'm Baffled... don't know where else to look..
Thanks in advance..
Brook
I am getting this error when I am trying to OutPutto my report:
Microsoft Office Access can't save the output data to the file you've
selected.
here is my command button code:
Begin Code:
Private Sub cmdPrintPreview_Click()
Dim strReportName As String
Dim strCriteria As String
Dim strOutputName 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 = "rptcustomorders"
strCriteria = "[orderid]= " & Me![orderid]
DoCmd.OpenReport strReportName, acViewPreview, , strCriteria
If MsgBox("Do you want to save the report to disk?", vbYesNo +
vbQuestion, "Save Report") = vbYes Then
strOutputName = DLookup("[OrdNum]", "qryinventory") & " - " &
Format(Date, "dd/mm/yyyy")
DoCmd.OutputTo acOutputReport, strReportName, "Rich Text Format",
strOutputName, True
End If
End If
End Sub
End Code
I'm Baffled... don't know where else to look..
Thanks in advance..
Brook