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