INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Good/Bad Naming Practices

Avoid space characters in any 'Name' - Why ? by LittleSmudge
Posted: 16 Jul 02 (Edited 27 May 04)

By 'names of things' I mean any Access object that the database developer provides a name for.
Eg.
Table Names
    Field Names
Query Names
Form Names
    Control Names
    Variable Names
Report Names
etc.. ..


Although it is perfectly legal to have space characters in names, just because it is legal does NOT make it good practice.

Spaces in object names should be avoided like the plague.

Reasons:-
1) the absence of spaces clearly identifies a complete object.

2) You need never type another [ or ] bracket again.
[ and ] brackets are only necessary to enclose object names that have spaces in them.

It is true that Access will sometimes add [ ] brackets in places like QBE grids, of its own accord ( you won't go through life not seeing them ), but YOU will never need to type them again.

3) - Probobly most importantly.
If you use a field name, control name or variable in VBA code then there is a facility, in Debug Mode, to see what the value that the field, control or variable contains.
In break mode, if you hover your mouse over a variable, a box ( very much like a windows tool-tip ) appears at the mouse point and displays the contents of the variable etc.
This is extremely useful for debugging.

If there is a space in the name of your field, control or variable name then this does NOT work at all.



So - how do you maintain readability whilst avoiding the user of the dreadful space character?

NOT the underline character - because in certain circumstances the underline can become obscured and make reading the code by eye very diffecult.

The standard solution is to make all text lower case and then capitalise the first letter of each word in the object name.
Eg
TheFirstEventDate

This formatting approach is called 'ProperCase'


For further study on the topic of naming conventions look for the term Hungarian Notation ( Type "Hungarian Notation" into your favourite search engine and dig through the hundreds of links. - Or go to MicroSoft.Com and search there for a smaller number of ( better written? ) articles.)


'ope-that-'elps.

G LS

Back to Microsoft: Access Tables and Relationships FAQ Index
Back to Microsoft: Access Tables and Relationships Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close