Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

All in one Module or separate modules???

Status
Not open for further replies.

petrosky

Technical User
Aug 1, 2001
512
AU
Hi,

I was wondering if there is any difference between housing all your code blocks in one module or in separate modules?

IE. is there any performance hit one way or another?

I hope this isn't a totally stupid question

Peter. Remember- It's nice to be important,
but it's important to be nice :)
 
Peter,

Performancewise it makes no difference at all. Splitting things down into separate modules is just a better way or organising things - should make life much easier when you come back to make changes at a later date.

Ed Metcalfe.
 
From what I understand, the action that makes modules quick is compiling them. You can compile them when you have module code open.

hth,
GGleason
 
Thanks for the replies.

I actually don't have hundreds or even tens of functions yet but it doesn't hurt to look to the future.

If I do a compile & save will that compile all modules or just the open module?


Thanks again,

Peter. Remember- It's nice to be important,
but it's important to be nice :)
 
The way to tighten things up and get them into P-code (I think) is to create an MDE file. This reduces the size, compiles the code, and makes it impossible for anyone to read your code or mess with forms, reports, or modules.
Also you don't have to worry about de-compiline of your modules. The MDE's do benefit from occasional compacting, but they aren't subject to the bloat that occurs with MDB front ends.

BTW: Make sure you're splitting the db if you're going to do MDE.


Ed2020 hit it on the head. It's so much easier to reuse things if you've got them separated into dedicated modules, e.g., errorhandler, utilities, business rules, etc.
 
Thanks Quehay.

Good thoughts from all.


petrosky

Remember- It's nice to be important,
but it's important to be nice :)
 
It is my understanding that when you do a Compile All Modules that all the modules are compiled, not just the one you have open at the time. I don't know the difference between that exercise and the Compile and Save All Modules. Perhaps someone can shed some light on that.

GGleason
 
<i>It is my understanding that when you do a Compile All Modules that all the modules are compiled, not just the one you have open at the time. I don't know the difference between that exercise and the Compile and Save All Modules. Perhaps someone can shed some light on that.</i>


The difference is literally what it says. If you Compile All Modules it is not saved to disk at that point and you get to see the &quot;Do you want to save changes&quot; message a lot.

If you do a Compile And Save All Modules then your compiled code is saved to your hard disc .mdb file.


G LS
 
You should try to put your frequently used functions in one module, and your rarely used functions in another.

This is because Access does not load the modules until they are needed. So you will take a performance hit when the first function from a module is called. The only question about the performance hit will be: Is the module big (big performance hit), or small (small performance hit)?

Hope this helps,

Peter De Baets
Peter's Software - MS Access Tools for Developers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top