C
Chefjay22
Hey guys. I posted earlier on another issue and got a great response... so I
thought I would get your opinion on something.
First, I am not a programmer by trade... I am a MS Access Expert minus the
programming side. I am normally able to get Access to do almost anything I
need without, or with very limited programming. So here is the situation.
I have a procedure that runs a process. In this process I have about 8
queries that manipulate data in my tables. Two of my queries delete all
records from temp tables. Here is my function:
Private Sub CatchMissingAccounts()
On Error GoTo Err_cmdCatchMissingAccounts_ReportError
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryDeleteAccounts4MissingCompare"
DoCmd.OpenQuery "qryDeleteNewAccountsMissingAccts"
DoCmd.OpenQuery "qryBuildMPAccountsTemp" 'Writes MP Accounts to
tblAccounts4MissingCompare
DoCmd.OpenQuery "qryBuildSamAccountsTemp" 'Writes SAM Accounts to
tblAccounts4MissingCompare
DoCmd.OpenQuery "qryFindMissingAccounts" 'Writes unmatched records to
tblNewAccountsMissingAccounts
DoCmd.OpenQuery "qryUpdateRecoveredMissingRecord" 'Update MissingRecord Flag
DoCmd.OpenQuery "qryWriteMissingRecords2NewAccts" 'Writes completed records
to tblNewAccounts
DoCmd.SetWarnings True
Exit_CatchMissingAccounts:
Exit Sub
Err_cmdCatchMissingAccounts_ReportError:
MsgBox Err.Description
Resume Exit_CatchMissingAccounts
End Sub
My question is this. On the two delete queries,
"qryDeleteAccounts4MissingCompare" & "qryDeleteNewAccountsMissingAccts" my
boss wanted me to use VB code, And I assume SQL to delete the record sets...
what a pain in the butt! Both of the queries are SQL queries and they delete
the records from the tables fine... but in an effort to make my life a living
Hot place she wants me to create a recordset, open it...delete it, and close
it...
So is my above method better than this? Personally I feel my one line of
code is more efficient... but I need to be able to prove to her that her
method is a waste of time, and not to mention not in better practice. My
impression is that it would be best to go directly to the recodset to delete
the records than to create a recordset, only to delete it... What do you guys
think?
Thanks!
thought I would get your opinion on something.
First, I am not a programmer by trade... I am a MS Access Expert minus the
programming side. I am normally able to get Access to do almost anything I
need without, or with very limited programming. So here is the situation.
I have a procedure that runs a process. In this process I have about 8
queries that manipulate data in my tables. Two of my queries delete all
records from temp tables. Here is my function:
Private Sub CatchMissingAccounts()
On Error GoTo Err_cmdCatchMissingAccounts_ReportError
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryDeleteAccounts4MissingCompare"
DoCmd.OpenQuery "qryDeleteNewAccountsMissingAccts"
DoCmd.OpenQuery "qryBuildMPAccountsTemp" 'Writes MP Accounts to
tblAccounts4MissingCompare
DoCmd.OpenQuery "qryBuildSamAccountsTemp" 'Writes SAM Accounts to
tblAccounts4MissingCompare
DoCmd.OpenQuery "qryFindMissingAccounts" 'Writes unmatched records to
tblNewAccountsMissingAccounts
DoCmd.OpenQuery "qryUpdateRecoveredMissingRecord" 'Update MissingRecord Flag
DoCmd.OpenQuery "qryWriteMissingRecords2NewAccts" 'Writes completed records
to tblNewAccounts
DoCmd.SetWarnings True
Exit_CatchMissingAccounts:
Exit Sub
Err_cmdCatchMissingAccounts_ReportError:
MsgBox Err.Description
Resume Exit_CatchMissingAccounts
End Sub
My question is this. On the two delete queries,
"qryDeleteAccounts4MissingCompare" & "qryDeleteNewAccountsMissingAccts" my
boss wanted me to use VB code, And I assume SQL to delete the record sets...
what a pain in the butt! Both of the queries are SQL queries and they delete
the records from the tables fine... but in an effort to make my life a living
Hot place she wants me to create a recordset, open it...delete it, and close
it...
So is my above method better than this? Personally I feel my one line of
code is more efficient... but I need to be able to prove to her that her
method is a waste of time, and not to mention not in better practice. My
impression is that it would be best to go directly to the recodset to delete
the records than to create a recordset, only to delete it... What do you guys
think?
Thanks!