Referencing from Modules

prgwhiting

Registered User.
Local time
Today, 16:26
Joined
Apr 18, 2000
Messages
15
No urgency. I'm just writing a load of modules, and am trying to be really economical with space, and write as much of my code as possible only once. What I have which I'm really curious about is a Yes No MsgBox, which I want to, depending on what it is asking at any one time, run different functions. I.e. this box could be primed to ask you if you want to open a form, or if you want to create a new record. What I want to do is have a function that using only one version of the YES NO MESSAGE BOX function can have a variable action that it performs. I hope this is clear, and would appreciate any help
Thanks
Paul
 
Well, sure, you can do this, but because you can does not really mean you should.

If you pass a zillion parameters to a module, and have it do dozens of things, that module is going to be a real maintenance headache for the next programmer. It's much easier to maintain code if each module only handles a tightly related group of functions.

Access does not really require (hey, it doesn't encourage or even really support) "economical" coding. Access is basically a hog, and writing a heavily reused module isn't going to change its basic nature.

I'd bias this one in favor of ease of maintenance, but I've been around a while. Anyone else want to weigh in on this?
 
Agree with Chris, because unless you are incredibly good with documentation, you will have difficulty in a years time if there are any upgrades to be done such as additional functionality. And the likelihood of your succesor being able to understand it will be even slimmer.

In this day and age there is no need to count the bits as with ZX81 and other early computers. Also the extra time that it will take to process is getting smaller each day with PC's getting faster.

[This message has been edited by simongallop (edited 12-19-2000).]
 

Users who are viewing this thread

Back
Top Bottom