R
ragtopcaddy via AccessMonster.com
My Transferspreadsheet acExport line produces Error 3011, "The microsoft Jet
database engine could not find the object, 'qryLeaseEventStores'".
Here's the line:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
"qryLeaseEventStores", strRptPath, True
When I run the query, it runs just fine. However, it contains 2 references in
a subquery to the following function in a different module:
Public Function MonthLastDay(ByVal dCurrDate As Date)
Dim dFirstDayNextMonth As Date
On Error GoTo lbl_Error
MonthLastDay = Empty
dFirstDayNextMonth = DateSerial(CInt(Format(dCurrDate, "yyyy")), CInt
(Format(dCurrDate, "mm")) + 1, 1)
MonthLastDay = DateAdd("d", -1, dFirstDayNextMonth)
Exit Function
lbl_Error:
MsgBox Err.Description, vbOKOnly + vbExclamation
End Function
If I try to run the query while the code is running, I get an "Unknown Jet
Error" twice. I'm assuming its' not a coincidence that I have 2 instances of
the function in a couple of subqueries in qryLeaseEventStores.
When I step through the code that does the transferspreadsheet, it steps
through the function twice, as well.
Any ideas would be appreciated.
Thanks
database engine could not find the object, 'qryLeaseEventStores'".
Here's the line:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
"qryLeaseEventStores", strRptPath, True
When I run the query, it runs just fine. However, it contains 2 references in
a subquery to the following function in a different module:
Public Function MonthLastDay(ByVal dCurrDate As Date)
Dim dFirstDayNextMonth As Date
On Error GoTo lbl_Error
MonthLastDay = Empty
dFirstDayNextMonth = DateSerial(CInt(Format(dCurrDate, "yyyy")), CInt
(Format(dCurrDate, "mm")) + 1, 1)
MonthLastDay = DateAdd("d", -1, dFirstDayNextMonth)
Exit Function
lbl_Error:
MsgBox Err.Description, vbOKOnly + vbExclamation
End Function
If I try to run the query while the code is running, I get an "Unknown Jet
Error" twice. I'm assuming its' not a coincidence that I have 2 instances of
the function in a couple of subqueries in qryLeaseEventStores.
When I step through the code that does the transferspreadsheet, it steps
through the function twice, as well.
Any ideas would be appreciated.
Thanks