jfgambit
Kinetic Card Dealer
- Local time
- Today, 00:21
- Joined
- Jul 18, 2002
- Messages
- 798
Ok I'm stumped...I had the following code on the OnClick event of a command button:
It was running fine in one db, but when I transfered it over to a new one I receive the following error message:
Runtime Error '3011'
The Microsoft jet Database Engine could not find the the object '020204Cust.tab' Make sure the object exists and that you spelled its name and path name correctly.
The Debug is on the following line:
Any ideas??
PHP:
Private Sub cmdExpCust_Click()
Dim strPath As String
Dim xlApp As Object
Dim xlSheet As Object
Dim rdCnt As Variant
Dim rwSet As Variant
txtDat = Format(Date, "mmddyy")
strPath = "C:\MSOFFICE\QBookExports\CUSTS\" & txtDat & "CUST.tab"
striif = "C:\MSOFFICE\QBookExports\CUSTS\" & txtDat & "CUST.IIF"
qryNM = "qryModQBExportCust"
DoCmd.TransferText acExportDelim, "CustExportSpec", qryNM, strPath
'Count the number of records in the Export
rdCnt = DCount("[InItm]", qryNM)
rwSet = (rdCnt + 3)
'open the Excel document move the information down two rows, add the headers and footers required by Quickbooks
Set xlApp = CreateObject("Excel.Application")
Set xlSheet = xlApp.Workbooks.Open(strPath)
With xlApp
.Application.Visible = True
.Application.Workbooks(1).Sheets.select
.Application.Rows(1).select
.Application.Selection.Delete
.Application.Rows("1:2").select
.Application.Selection.Insert Shift:=-4121
.Application.ActiveSheet.cells(1, 1).Value = "!CUST"
.Application.ActiveSheet.cells(1, 2).Value = "NAME"
.Application.ActiveSheet.cells(1, 3).Value = "BADDR1"
.Application.ActiveSheet.cells(1, 4).Value = "BADDR2"
.Application.ActiveSheet.cells(1, 5).Value = "BADDR3"
.Application.ActiveSheet.cells(1, 6).Value = "BADDR4"
.Application.ActiveSheet.cells(1, 7).Value = "BADDR5"
.Application.ActiveSheet.cells(1, 8).Value = "CTYPE"
.Application.ActiveSheet.cells(1, 9).Value = "TAXABLE"
.Application.ActiveSheet.cells(1, 10).Value = "NOTEPAD"
.Application.ActiveSheet.cells(1, 11).Value = "COMPANYNAME"
.Application.ActiveSheet.cells(1, 12).Value = "CUSTFLD1"
.Application.ActiveSheet.cells(1, 13).Value = "CUSTFLD2"
.Application.ActiveSheet.cells(1, 14).Value = "CUSTFLD3"
.Application.ActiveSheet.cells(1, 15).Value = "CUSTFLD4"
.Application.ActiveSheet.cells(1, 16).Value = "JOBTYPE"
.Application.ActiveSheet.cells(1, 17).Value = "JOBSTATUS"
.Application.ActiveSheet.cells(2, 1).Value = "!ENDGRP"
.Application.ActiveSheet.cells(rwSet, 1).Value = "ENDGRP"
.Application.activeworkbook.Save
.Application.activeworkbook.Close
.Quit
End With
On Error Resume Next
Name strPath As striif
End Sub
It was running fine in one db, but when I transfered it over to a new one I receive the following error message:
Runtime Error '3011'
The Microsoft jet Database Engine could not find the the object '020204Cust.tab' Make sure the object exists and that you spelled its name and path name correctly.
The Debug is on the following line:
PHP:
DoCmd.TransferText acExportDelim, "CustExportSpec", qryNM, strPath
Any ideas??