Speed

  • Thread starter Thread starter Carol
  • Start date Start date
C

Carol

I am running Access 2000 VBA over a corporate LAN and need
the code to perform as fast as possible. The question is
which is faster: dim or no dim for variables; using
docmd.runsql or docmd.openquery; putting each subroutine
in a separate module or putting related routines in one
module? etc.

Thanks
 
Even if it were faster (and I doubt it is), not using Option Explicit (which
therefore forces you to dim all variables) is a recipe for disaster as far
as I'm concerned.

I doubt there will be any noticable difference putting each subroutine in a
separate module vs. putting related routines in one module. I personally
believe the latter makes it easier to reuse the code.

You might find setting a reference to DAO, and using the Database objects
Execute method to be more efficient than either DoCmd.RunSQL or
DoCmd.OpenQuery, plus it offers the ability to trap any errors that might
arise in running the SQL.
 
Back
Top