Better method ?

  • Thread starter Thread starter rob
  • Start date Start date
R

rob

I am basically refreshing some data in a table. Is there a better method
(either from a performance or programming standpoint) ?

DoCmd.SetWarnings False
DoCmd.OpenQuery ("qdelTEMPtblLocalWhatever")
DoCmd.OpenQuery ("qappTEMPtblLocalWhatever")
DoCmd.SetWarnings True
 
That's basically okay.

Possibly better:

With dbEngine(0)(0)
.Execute "qdelTEMPtblLocalWhatever", dbFailOnError
.Execute "qappTEMPtblLocalWhatever", dbFailOnError
End With
 
Test and see.

Once you SetWarnings false, I don't believe you will see any error message
if the action queries do not complete.

Likewise, you will not see an error message with Execute unless you use the
dbFailOnError switch.

If you want to guarantee a complete all-or-nothing or else roll back, you
can use a transaction. Probably not relevant for your temp table, but
details in:
Archive: Move records to another table
at:
http://members.iinet.net.au/~allenbrowne/ser-37.html
 
Back
Top