Re: Why use modules
- From: "David C. Holley" <DavidCHolley@xxxxxxxxxxxx>
- Date: Wed, 17 Aug 2005 22:20:36 -0400
1. How you name your subs, functions, variables, modules, children is entirely up to you, however keep in mind what my old prof used to say - "The true cost of software developement is NOT how much is costs to bring the application online, it is how much it costs to debug or revise the code afterward." The point being that at some point you or someone else is going to have go into your code and understand what it does. To that end, name everything in such a manner that its clear as to what it does. (I personally use prefixes to my field names & variables to indicate the type as in txtName tells me that the field is a TEXT type. lngTransportId tells me that the variable is DIM'd as LONG.)
2. The decision to spin out a procedure from an object's module to a free standing module depends on its purpose and expected use. I for one have a module named OUTLOOK FUNCTIONS that contains all my subs/functions that are my Access-Outlook interface. Although the subs are only called from one specific form, I wrote them in a manner so that they can be called from any form. I did that to make things easier if I needed to call them from other forms.
3. Now that I think of it, I've gotten into the habit that the only code in my forms/objects is code that is specific to those objects (requery a control, calling subs that need to run on form events, etc.). All others (form validation, Outlook/Word automation, functions, etc.) are in modules to allow for flexibility.
4. Never name your
Teewan wrote:
Hi all,
Can someone point me to information or give me an idea as to the advantages/diadvantages of using modules in my Access database. I've done a reasonable amount of coding for forms and events and while researching some information on automating outlook messages, tasks and reminders I'm trying to work out the dos and don'ts on using modules or can I just code this in to the cmdSave button which will be saving the information I need to put into the email messages. Also is there a naming convention Module 1 doesn't seem to informative.
Thanks in advance
.
- References:
- Why use modules
- From: Teewan
- Why use modules
- Prev by Date: RE: carry over a value in a field to same field in new record
- Next by Date: SQL for Quering Access Tables using a Table/Field List Table
- Previous by thread: RE: Why use modules
- Next by thread: Re: Why use modules
- Index(es):
Relevant Pages
|