hints and tips for organising VBA code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

As I have constructed my code "on-the-hoof" as I have developed the db, the
application has decided to corrupt itself. I am still trying to de-corrupt
the file without much luck.

My VBA code are in a different number of modules. Should this be the case or
is it better to have all the code in a single module.

Any website links I can look at?

cheers in advance
 
scubadiver said:
As I have constructed my code "on-the-hoof" as I have developed the
db, the application has decided to corrupt itself. I am still trying
to de-corrupt the file without much luck.

My VBA code are in a different number of modules. Should this be the
case or is it better to have all the code in a single module.

Any website links I can look at?

cheers in advance

Generally more modules which organize the functions and subs into logical
"chunks" is better. Not only does that make it easier for the developer to
find stuff, but when you use a sub, function, or public variable contained
in a module then the *entire* module is loaded into memory and stays there.
If you have all code in one humongous module then that entire module will
get loaded every time. If broken up into smaller modules those modules
which are seldom used won't have to be loaded.
 
Back
Top