Hi,
I have a reports database that should email a report to a specific party. That works fine. It should then run a report that gets stored in a folder on our network. When the second DoCmd runs I get this error message:
Run-time error 2046
Command or action 'Output To' isn't available now.
Below is the code I'm using, can anyone help me figure out why this isn't working. Thank you in advance.
Private Sub cmdByMonth_Click()
Dim txtTo, txtCC, txtBCC, txtSubject, txtMessage As String
txtTo = "ManagersReports"
txtCC = ""
txtBCC = ""
txtSubject = "WBLP Comparison by Years"
txtMessage = ""
DoCmd.SendObject acSendReport, "WBLPComparisonbyYrs", "SnapshotFormat(*.snp)", _
txtTo, txtCC, txtBCC, txtSubject, txtMessage, False
DoCmd.OutputTo acOutputReport, "WBLPComparisonbyYrs", "SnapshotFormat(*.snp)", _
"\\Bospicfs01\Groups\Databases_Shared\Reports\Weekly Placements\WBLP Comparison by Years.snp", False, ""
End Sub
I have a reports database that should email a report to a specific party. That works fine. It should then run a report that gets stored in a folder on our network. When the second DoCmd runs I get this error message:
Run-time error 2046
Command or action 'Output To' isn't available now.
Below is the code I'm using, can anyone help me figure out why this isn't working. Thank you in advance.
Private Sub cmdByMonth_Click()
Dim txtTo, txtCC, txtBCC, txtSubject, txtMessage As String
txtTo = "ManagersReports"
txtCC = ""
txtBCC = ""
txtSubject = "WBLP Comparison by Years"
txtMessage = ""
DoCmd.SendObject acSendReport, "WBLPComparisonbyYrs", "SnapshotFormat(*.snp)", _
txtTo, txtCC, txtBCC, txtSubject, txtMessage, False
DoCmd.OutputTo acOutputReport, "WBLPComparisonbyYrs", "SnapshotFormat(*.snp)", _
"\\Bospicfs01\Groups\Databases_Shared\Reports\Weekly Placements\WBLP Comparison by Years.snp", False, ""
End Sub