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.)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.