A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Speed



 
 
Thread Tools Display Modes
  #1  
Old June 21st, 2004, 12:21 PM
Carol
external usenet poster
 
Posts: n/a
Default Speed

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
  #2  
Old June 21st, 2004, 12:57 PM
Douglas J. Steele
external usenet poster
 
Posts: n/a
Default Speed

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.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)


"Carol" wrote in message
...
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



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:23 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.