Should I have several modules or just one?

yippie_ky_yay

Registered User.
Local time
Today, 15:13
Joined
Jul 30, 2002
Messages
338
Hello,

Currently, I have 3 modules each with only 1 function. I don't think that the names of the modules have any impact on the database at all so I'm just wondering if there are any pros and/or cons to having everything in 1 module? Would there be a performance difference one way or the other?

Thanks,
-Sean
 
I like to group my modules by function (major procedures each get their own module, common utility functions get their own) I don't think it makes a difference performance-wise, but I've never tested specifically for that.
 
Yes, that makes sense - thanks dcx!

-Sean
 
yippie_ky_yay said:
Hello,

I'm just wondering if there are any pros and/or cons to having everything in 1 module? Would there be a performance difference one way or the other?

Thanks,
-Sean

Sean,

I'm relatively certain that once any function in a VBA module has been called, the entire module is thrown into RAM. And it remains there, holding onto its territory until the app closes. So resource-wise, if your app might be running on clients with not much memory, consider throwing infrequently used functions (ones that might not be called every session) into their own modules. A niggling point, especially if you only have three functions.

Regards,
Tim
 

Users who are viewing this thread

Back
Top Bottom