| Chat with a LIVE Microsoft
Access Expert! |
||||
|
||||
|
#1
|
||||
|
||||
|
Error 3011
Ok I'm stumped...I had the following code on the OnClick event of a command button:
PHP Code:
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 Code:
__________________
"I know what you're t'inkin', ma petite. Dat Gambit... still de suave one, no?" |
| Sponsored Links |
|
#2
|
||||
|
||||
|
Aren't you missing a \ character (or two) in here?:
strPath = "C:MSOFFICEQBookExportsCUSTS\" & txtDat & "CUST.tab" Shouldn't it be? strPath = "C:\MSOFFICE\QBookExports\CUSTS\" & txtDat & "CUST.tab" or something like that? |
|
#3
|
||||
|
||||
|
No...code is correct (looks like when I copied it in PHP I lost the "\")
Code looks like this: 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
__________________
"I know what you're t'inkin', ma petite. Dat Gambit... still de suave one, no?" |
|
#4
|
||||
|
||||
|
Looks like you have not Dim'd all [txtDat, striif, qryNM] of your strings at the top. Does the code compile okay?
I suggest that you add a message box in between your code to see what "Access" is using for your strings. txtDat = Format(Date, "mmddyy") strPath = "C:MSOFFICE\QBookExports\CUSTS\" & txtDat & "CUST.tab" striif = "C:MSOFFICE\QBookExports\CUSTS" & txtDat & "CUST.IIF" qryNM = "qryModQBExportCust" MsgBox txtDat MsgBox strPath MsgBox striif MsgBox qryNM DoCmd.TransferText acExportDelim, "CustExportSpec", qryNM, strPath HTH
__________________
.................................................. ...... Searching this forum or Microsoft.com or MSDN.com or Google is a great way to discover and learn the answers to your Access programming questions.Well if it seems to be real, it's illusion... I am using Access 2007 with Windows XP The Advanced Search function on this forum really does work. ![]() .................................................. ......
|
|
#5
|
||||
|
||||
|
Ran the checks and everything is coming back fine...
MsgBox txtDat = 020204 MsgBox strPath = C:\MSOFFICE\QBookExports\CUSTS\020204CUST.tab MsgBox striif = C:\MSOFFICE\QBookExports\CUSTS\020204CUST.iif MsgBox qryNM = qryModQBExportCust This form works in another Db. As soon as I import it into a new Db, it no longer works. This is seriously driving me nuts!!!!
__________________
"I know what you're t'inkin', ma petite. Dat Gambit... still de suave one, no?" |
|
#6
|
||||
|
||||
|
Does the new db contain the export specification "CustExportSpec"?
Is the new db missing any references?
__________________
.................................................. ...... Searching this forum or Microsoft.com or MSDN.com or Google is a great way to discover and learn the answers to your Access programming questions.Well if it seems to be real, it's illusion... I am using Access 2007 with Windows XP The Advanced Search function on this forum really does work. ![]() .................................................. ......
|
|
#7
|
||||
|
||||
|
No....get this...
I added Docmd.OpenQuery qryNm before Docmd.transfertext.... And it works... What the heck??
__________________
"I know what you're t'inkin', ma petite. Dat Gambit... still de suave one, no?" |
|
#8
|
||||
|
||||
|
Out of curiosity, does this work?
DoCmd.TransferText acExportDelim, "CustExportSpec", "qryModQBExportCust", strPath or this... Dim qryNM as String qryNM = "qryModQBExportCust" DoCmd.TransferText acExportDelim, "CustExportSpec", qryNM, strPath
__________________
.................................................. ...... Searching this forum or Microsoft.com or MSDN.com or Google is a great way to discover and learn the answers to your Access programming questions.Well if it seems to be real, it's illusion... I am using Access 2007 with Windows XP The Advanced Search function on this forum really does work. ![]() .................................................. ......
|
|
#9
|
||||
|
||||
|
Found out it was the Cust ExportSpec...I added a field to the export and it was not mapped in the Export Specification on the new Db...
Figured it out by taking "CustExportSpec" out of the TransferText line. Thanks for the help.
__________________
"I know what you're t'inkin', ma petite. Dat Gambit... still de suave one, no?" |
| Sponsored Links |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|