why am I getting a 3010 error?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
Andy,

I found the following explanation for the 3010 error on the microsoft website:

"You are attempting to add a file which is already listed as part of the
component. You can publish a file into a given component only once."\

Hope that helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top