OutputTo issues

msyoung01

Board Regular
Joined
Jul 23, 2002
Messages
51
Alrighty, I have code that is trying to output to tables from access to excel, but it tells me that the action/command is not available:

Sub Form_Open(Cancel As Integer)
On Error GoTo ReportProcessing_Err

DoCmd.RunCommand acCmdAppMinimize
Dim reportname1 As String
Dim reportname2 As String
Dim reportname3 As String
Dim reportname4 As String
Dim reportcount1 As Long
Dim reportcount2 As Long
Dim reportcount3 As Long
Dim reportcount4 As Long
Dim tablecount1 As Long
Dim tablecount2 As Long
Dim tablecount3 As Long
Dim tablecount4 As Long
DoCmd.SetWarnings False
DoCmd.Echo False, "Reports Are Printing"
reportname1 = "Purchase Orders Received_rpt"
reportname2 = "Purchase Order Changes Received_rpt"
reportname3 = "Purchase Order Acknowledgments Sent_rpt"
reportname4 = "Customer Invoices Sent_rpt"
'Purchase Orders Received
DoCmd.OpenQuery "Purchase Orders Received Table Creation_MKTBL", acNormal, acEdit
If Len(Dir("\\Nppnt1\Infosys\Access EDI JDE\Received Documents Templates\Hughes PO Receiving Documents Template.xls")) > 0 Then
DoCmd.OpenQuery "Hughes Purchase Orders Received_APND", acNormal, acEdit
End If
If Len(Dir("\\Nppnt1\Infosys\Access EDI JDE\Received Documents Templates\NWW PO Receiving Documents Template.xls")) > 0 Then
DoCmd.OpenQuery "NWW Purchase Orders Received_APND", acNormal, acEdit
End If
DoCmd.OpenQuery "Purchase Orders Received Delete_DLT", acNormal, acEdit
reportcount1 = DCount("[Purchase Order Number]", "Purchase Orders Received_TBL")
If reportcount1 > 0 Then
DoCmd.OpenQuery "Purchase Orders Received Import_APND", acNormal, acEdit
DoCmd.OpenReport (reportname1), acViewNormal, "", ""
DoCmd.OpenReport (reportname1), acViewNormal, "", ""
End If

'Purchase Order Acknowledgments
DoCmd.OpenQuery "Purchase Order Acknowledgment Base_MKTBL", acNormal, acEdit
reportcount3 = DCount("[AKPO]", "Purchase Order Acknowledgments_TBL")
If reportcount3 > 0 Then
DoCmd.OpenQuery "Hughes Purchase Order Acknowledgments_MKTBL", acNormal, acEdit
DoCmd.OpenQuery "NWW Purchase Order Acknowledgments_MKTBL", acNormal, acEdit
DoCmd.OutputTo acOutputTable, "Hughes Purchase Order Acknowledgments_TBL", acFormatXLS, "\\nppnt1\Infosys\Access EDI JDE\Purchase Order Acknowledgment Files\Hughes Purchase Order Acknowledgments.xls", False, ""
DoCmd.OutputTo acOutputTable, "NWW Purchase Order Acknowledgments_TBL", acFormatXLS, "\\nppnt1\Infosys\Access EDI JDE\Purchase Order Acknowledgment Files\NWW Purchase Order Acknowledgments.xls", False, ""
DoCmd.OpenReport (reportname3), acViewNormal, "", ""
End If

DoCmd.SetWarnings True
DoCmd.Quit acQuitSaveNone

ReportProcessing_Exit:
Exit Sub

ReportProcessing_Err:
MsgBox Error$
Resume ReportProcessing_Exit

End Sub

Now, as you can see that database is minimized at the time of execution, but i have this action in other databases with no problems, any ideas would be greatly appreciated...
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Well, first things first. Take out your Error Handler so that you can determine exactly where your code is breaking.
 
Upvote 0

Forum statistics

Threads
1,221,575
Messages
6,160,603
Members
451,657
Latest member
Ang24

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top