sportsguy
Finance wiz, Access hack
- Local time
- Yesterday, 20:42
- Joined
- Dec 28, 2004
- Messages
- 363
good afternoon readers!
I have manual queries which run just fine, but in the following sub, the second append query blows up and give the error 3035 System resource exceeded. :banghead: so I am asking for the experts' help.
The data is copied from excel and pasted into a form in table stgIS4515, works fine. The table has many duplicate records which must be totaled for usefulness. round numbers, 85K rows get totaled into 20K rows and appended in a second table, tmpIS4515. the first table, stgIS4515, have all records deleted and then the second table, tmpIS4515, is pasted back into the first table, stgIS4515, to continue with processing. The stg and tmp tables are identical with autonumber key field.
the second query is a simple append query, which has no totalling. . .
Any suggestions for getting the code to work without erroring and corrupting the stgIS4515 table?
thanks in advance, sportsguy
append query 2 which blows up the table is seen below
I have manual queries which run just fine, but in the following sub, the second append query blows up and give the error 3035 System resource exceeded. :banghead: so I am asking for the experts' help.
The data is copied from excel and pasted into a form in table stgIS4515, works fine. The table has many duplicate records which must be totaled for usefulness. round numbers, 85K rows get totaled into 20K rows and appended in a second table, tmpIS4515. the first table, stgIS4515, have all records deleted and then the second table, tmpIS4515, is pasted back into the first table, stgIS4515, to continue with processing. The stg and tmp tables are identical with autonumber key field.
the second query is a simple append query, which has no totalling. . .
Any suggestions for getting the code to work without erroring and corrupting the stgIS4515 table?
thanks in advance, sportsguy
Code:
Public Sub Rebuildstg4515()
On Error GoTo Err_Rebuildstg4515
Forms!frmHome.Visible = True
DoCmd.Close acForm, "frm4515D", acSaveNo
With DoCmd
.Hourglass True
.SetWarnings False
.RunSQL "DELETE tmpIS4515.* FROM tmpIS4515;"
Debug.Print "Query Delete1"
Call Pause(5)
.OpenQuery "aptmpIS4515", acViewNormal, acAdd
Debug.Print "Query Append1"
Call Pause(5)
.RunSQL "DELETE stgIS4515.* FROM stgIS4515;"
Debug.Print "Query Delete2"
Call Pause(5)
.OpenQuery "apstgIS4515", acViewNormal, acAdd
Debug.Print "Query Append2"
Call Pause(5)
.RunSQL "DELETE tmpIS4515.* FROM tmpIS4515;"
Debug.Print "Query Delete3"
Call Pause(5)
.Hourglass False
.SetWarnings True
End With
DoCmd.OpenForm "frm4515D", acNormal
Forms!frmHome.Visible = False
MsgBox "Data Totaled and Saved!", vbExclamation, "NATIONAL GRID Financial Business Partners"
Sub_Exit:
Exit Sub
Err_Rebuildstg4515:
Debug.Print Err.Number & " " & Err.Description
Application.Echo True
DoCmd.Hourglass False
DoCmd.SetWarnings True
Resume Sub_Exit
End Sub
append query 2 which blows up the table is seen below
Code:
INSERT INTO stgIS4515 ( FY, Fiscal_Qtr, FiscalPeriod, FYMonthSAP, CYMonthSAP, L04_OCC, L05_OCC, L06_OCC, CostCenter, CostCenter_Desc, EEID, EE_Name, Job_Code, Position_Key, Job_Title, Supervisor, [Band], L03_RCC, L04_RCC, L05_RCC, L06_RCC, Dept, Dept_Desc, OrderID, Order_Text, INVP, INVP_Descr, INVP_Family, INVP_Fam_Descr, INVP_Org, WBS, Project, Project_Text, Activity, Activity_Text, Allocation_Code, L02_CostType, L03_CostType, Functional_Cost, FERC, GL_Account, GL_Acct_Desc, Payroll_Area, Wage_Type, Work_Date, Hours, Total_Amt, OPEX, CAPEX, OTHER, OPEX_OtherL03, OPEX_OtherL04, OPEX_OtherL05, Delivery_Team, Productivity, ProductivityActivity, ProjectType, TimeEntryType, ExclusionManual )
SELECT tmpIS4515.FY, tmpIS4515.Fiscal_Qtr, tmpIS4515.FiscalPeriod, tmpIS4515.FYMonthSAP, tmpIS4515.CYMonthSAP, tmpIS4515.L04_OCC, tmpIS4515.L05_OCC, tmpIS4515.L06_OCC, tmpIS4515.CostCenter, tmpIS4515.CostCenter_Desc, tmpIS4515.EEID, tmpIS4515.EE_Name, tmpIS4515.Job_Code, tmpIS4515.Position_Key, tmpIS4515.Job_Title, tmpIS4515.Supervisor, tmpIS4515.[Band], tmpIS4515.L03_RCC, tmpIS4515.L04_RCC, tmpIS4515.L05_RCC, tmpIS4515.L06_RCC, tmpIS4515.Dept, tmpIS4515.Dept_Desc, tmpIS4515.OrderID, tmpIS4515.Order_Text, tmpIS4515.INVP, tmpIS4515.INVP_Descr, tmpIS4515.INVP_Family, tmpIS4515.INVP_Fam_Descr, tmpIS4515.INVP_Org, tmpIS4515.WBS, tmpIS4515.Project, tmpIS4515.Project_Text, tmpIS4515.Activity, tmpIS4515.Activity_Text, tmpIS4515.Allocation_Code, tmpIS4515.L02_CostType, tmpIS4515.L03_CostType, tmpIS4515.Functional_Cost, tmpIS4515.FERC, tmpIS4515.GL_Account, tmpIS4515.GL_Acct_Desc, tmpIS4515.Payroll_Area, tmpIS4515.Wage_Type, tmpIS4515.Work_Date, tmpIS4515.Hours, tmpIS4515.Total_Amt, tmpIS4515.OPEX, tmpIS4515.CAPEX, tmpIS4515.OTHER, tmpIS4515.OPEX_OtherL03, tmpIS4515.OPEX_OtherL04, tmpIS4515.OPEX_OtherL05, tmpIS4515.Delivery_Team, tmpIS4515.Productivity, tmpIS4515.ProductivityActivity, tmpIS4515.ProjectType, tmpIS4515.TimeEntryType, tmpIS4515.ExclusionManual
FROM tmpIS4515;