Hello,
Please help. I have about 17 queries that I am using to manipulate data. I am openeing them from a code module. Though it seems that every three times I run it (to test), it returns invalid data. I beleive it is running out of memory, once every couple times I run it...
Is the following appropriate or should I be using a querydef object. Is there a line of code that I am missing that may help with the memory leakage?
'run query to update EXEMPT
DoCmd.SetWarnings False
DoCmd.OpenQuery "delete_exempt", acNormal, acEdit
DoCmd.Close acQuery, "delete_exempt", acSaveNo
DoCmd.OpenQuery "append_human_to_exempt_all_exempt", acNormal, acEdit
DoCmd.Close acQuery, "append_human_to_exempt_all_exempt", acSaveNo
DoCmd.OpenQuery "update_exempt", acNormal, acEdit
DoCmd.Close acQuery, "update_exempt", acSaveNo
DoCmd.OpenQuery "SUM_EXEMPT", acNormal, acEdit
DoCmd.Close acQuery, "SUM_EXEMPT", acSaveNo
DoCmd.OpenQuery "delete_totexemp", acNormal, acEdit
DoCmd.Close acQuery, "delete_totexemp", acSaveNo
DoCmd.OpenQuery "SUMEXEMP_TO_TOTEXEMP", acNormal, acEdit
DoCmd.Close acQuery, "SUMEXEMP_TO_TOTEXEMP", acSaveNo
DoCmd.SetWarnings True
'run query to update NON-EXEMPT
DoCmd.SetWarnings False
DoCmd.OpenQuery "delete_nonexemp", acNormal, acEdit
DoCmd.Close acQuery, "delete_exempt", acSaveNo
DoCmd.OpenQuery "append_human_to_noexempt_all_nonexempt", acNormal, acEdit
DoCmd.Close acQuery, "append_human_to_noexempt_all_nonexempt", acSaveNo
DoCmd.OpenQuery "update_nonexempt", acNormal, acEdit
DoCmd.Close acQuery, "update_nonexempt", acSaveNo
DoCmd.OpenQuery "SUM_NONEXEMP", acNormal, acEdit
DoCmd.Close acQuery, "SUM_NONEXEMP", acSaveNo
DoCmd.OpenQuery "delete_totnone", acNormal, acEdit
DoCmd.Close acQuery, "delete_totnone", acSaveNo
DoCmd.OpenQuery "SUMNONE_TO_TOTNONE", acNormal, acEdit
DoCmd.Close acQuery, "SUMNONE_TO_TOTNONE", acSaveNo
DoCmd.SetWarnings True
'run query to delete HUMAN and append from TOTEXEMP & TOTNONE
DoCmd.SetWarnings False
DoCmd.OpenQuery "delete_human", acNormal, acEdit
DoCmd.Close acQuery, "delete_human", acSaveNo
DoCmd.OpenQuery "append_TOTEXEMP_TO_human", acNormal, acEdit
DoCmd.Close acQuery, "append_TOTEXEMP_TO_human", acSaveYes
DoCmd.OpenQuery "append_TOTNONE_TO_human", acNormal, acEdit
DoCmd.Close acQuery, "append_TOTNONE_TO_human", acSaveYes
DoCmd.SetWarnings True
...please help
Please help. I have about 17 queries that I am using to manipulate data. I am openeing them from a code module. Though it seems that every three times I run it (to test), it returns invalid data. I beleive it is running out of memory, once every couple times I run it...
Is the following appropriate or should I be using a querydef object. Is there a line of code that I am missing that may help with the memory leakage?
'run query to update EXEMPT
DoCmd.SetWarnings False
DoCmd.OpenQuery "delete_exempt", acNormal, acEdit
DoCmd.Close acQuery, "delete_exempt", acSaveNo
DoCmd.OpenQuery "append_human_to_exempt_all_exempt", acNormal, acEdit
DoCmd.Close acQuery, "append_human_to_exempt_all_exempt", acSaveNo
DoCmd.OpenQuery "update_exempt", acNormal, acEdit
DoCmd.Close acQuery, "update_exempt", acSaveNo
DoCmd.OpenQuery "SUM_EXEMPT", acNormal, acEdit
DoCmd.Close acQuery, "SUM_EXEMPT", acSaveNo
DoCmd.OpenQuery "delete_totexemp", acNormal, acEdit
DoCmd.Close acQuery, "delete_totexemp", acSaveNo
DoCmd.OpenQuery "SUMEXEMP_TO_TOTEXEMP", acNormal, acEdit
DoCmd.Close acQuery, "SUMEXEMP_TO_TOTEXEMP", acSaveNo
DoCmd.SetWarnings True
'run query to update NON-EXEMPT
DoCmd.SetWarnings False
DoCmd.OpenQuery "delete_nonexemp", acNormal, acEdit
DoCmd.Close acQuery, "delete_exempt", acSaveNo
DoCmd.OpenQuery "append_human_to_noexempt_all_nonexempt", acNormal, acEdit
DoCmd.Close acQuery, "append_human_to_noexempt_all_nonexempt", acSaveNo
DoCmd.OpenQuery "update_nonexempt", acNormal, acEdit
DoCmd.Close acQuery, "update_nonexempt", acSaveNo
DoCmd.OpenQuery "SUM_NONEXEMP", acNormal, acEdit
DoCmd.Close acQuery, "SUM_NONEXEMP", acSaveNo
DoCmd.OpenQuery "delete_totnone", acNormal, acEdit
DoCmd.Close acQuery, "delete_totnone", acSaveNo
DoCmd.OpenQuery "SUMNONE_TO_TOTNONE", acNormal, acEdit
DoCmd.Close acQuery, "SUMNONE_TO_TOTNONE", acSaveNo
DoCmd.SetWarnings True
'run query to delete HUMAN and append from TOTEXEMP & TOTNONE
DoCmd.SetWarnings False
DoCmd.OpenQuery "delete_human", acNormal, acEdit
DoCmd.Close acQuery, "delete_human", acSaveNo
DoCmd.OpenQuery "append_TOTEXEMP_TO_human", acNormal, acEdit
DoCmd.Close acQuery, "append_TOTEXEMP_TO_human", acSaveYes
DoCmd.OpenQuery "append_TOTNONE_TO_human", acNormal, acEdit
DoCmd.Close acQuery, "append_TOTNONE_TO_human", acSaveYes
DoCmd.SetWarnings True
...please help