Better method ?

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
 
A

Allen Browne

That's basically okay.

Possibly better:

With dbEngine(0)(0)
.Execute "qdelTEMPtblLocalWhatever", dbFailOnError
.Execute "qappTEMPtblLocalWhatever", dbFailOnError
End With
 
A

Allen Browne

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
 

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

Similar Threads


Top