Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The following code works until I get to the DoCmd.TransferSpreadsheet line.
I have confirmed that the table, TempTable, is deleted and then generated. Thanks in advance. I have another module, from which i created this one thru cut and paste (which DOES NOT have the DoCmd.DeleteObject command, that works perfectly. What am I doing wrong? Thanks in advance. DoCmd.DeleteObject acTable, "TempTable" strSheetQuery = "SELECT T_FY AS [Fiscal Year], P_FUND AS FUND, P_BORG AS BORG, P_NAME AS [Project Name], T_CORG AS CORG, T_BOC AS BOC, BOC.Description AS [BOC Description], T_Quarter AS Quarter, IIF((T_Type='1' OR T_Type = '2'),T_Amount,0) AS ALLOCATION, IIF(T_Type='C',T_Amount,0) AS PLANNED, IIF(T_Type='O',T_Amount,0) AS OBLIGATION, T_Description AS Description, T_DocumentNumber AS [Document Number], T_DocumentDate AS [Document Date], T_Type AS Type " & _ "INTO TempTable " & _ "FROM BOC INNER JOIN (Projects INNER JOIN [Transaction] ON Projects.P_ID = Transaction.T_Project) ON BOC.BOC = Transaction.T_BOC " & _ "WHERE Transaction.T_Closed = False AND " & _ "T_Project = " & strProject & _ " ORDER BY T_FY & T_Project & T_BOC & T_Quarter & T_Type & T_DocumentDate" DoCmd.RunSQL (strSheetQuery) DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel7, "TempTable", Application.CurrentProject.Path & "\TempSheet", True |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Visual Basic Error Run Time Error, Type Mismatch | Excel Discussion (Misc queries) | |||
Counting instances of found text (Excel error? Or user error?) | Excel Worksheet Functions | |||
run-time error '1004': Application-defined or object-deifined error | Excel Programming | |||
Automation Error, Unknown Error. Error value - 440 | Excel Programming |