Naming Objects Within Microsoft Access Databases: What"s In A Name? Understanding Naming Conventions
I have no count of the number of times I've turned up at a client's site to carry out either an audit of an Access database or had to repair or redevelop parts of a database only to find myself hunting around wasting valuable time looking for associated objects, dependencies and other related controls when a simple policy of adopting some sort of naming rules and thus standardise an Access database would have been just the ticket; a ticket that may have said "Discount" on my invoice to the client! Naming objects with Microsoft Access databases (i.
e.
Tables, Queries, Forms, Reports, Macros and Modules) using a derived set of conventions and prefixes makes users, developers and other members who will inherit an Access database lives more bearable and manageable for future maintenance.
Microsoft Access does not impose any disciplines and life can become chaotic unless users take care right from the very start.
So, the following conventions will elevate and avoid problems.
Putting aside VBA programming for now and just focusing on the objects readily accessible in an Access database, there are two sections I want to highlight in this article for now to get you started:
For example, a table (list) of employees might look like tbl_Employees or tblEmployees.
Notice how I've capitalised the first letter (and for each word if more than one word is used) as well as making it plural as it is a collection of individuals.
Also note, though Access is not fussy, I tend not to have spaces at all between words or anywhere in the naming of objects as a rule - its good practice in general and more of the 'old school' approach especially when programming Access using VBA.
Extended Objects in Access The first section covered the essentials and once mastered users can consider extending Microsoft Access object a little further and be more explicit in adding a type of use for an object.
For example, Access Forms are screen interfaces that end-users will interact with but the types of uses for a form will vary from main input or read only form to a dialog box (pop-up) and a message box.
To help expand on this, the following list maybe extended to help identify and group types of use for various Access objects:
As long as you keep it consistent and other users work with you, then your own code of working practices will pay dividends in the long-term.
e.
Tables, Queries, Forms, Reports, Macros and Modules) using a derived set of conventions and prefixes makes users, developers and other members who will inherit an Access database lives more bearable and manageable for future maintenance.
Microsoft Access does not impose any disciplines and life can become chaotic unless users take care right from the very start.
So, the following conventions will elevate and avoid problems.
Putting aside VBA programming for now and just focusing on the objects readily accessible in an Access database, there are two sections I want to highlight in this article for now to get you started:
- Naming conventions for your objects in your database
- Naming conventions for extended objects in your database
- tbl = Table
- qry = Query
- frm = Form
- rpt = Report
- mcr = Macro
- mod = Module
For example, a table (list) of employees might look like tbl_Employees or tblEmployees.
Notice how I've capitalised the first letter (and for each word if more than one word is used) as well as making it plural as it is a collection of individuals.
Also note, though Access is not fussy, I tend not to have spaces at all between words or anywhere in the naming of objects as a rule - its good practice in general and more of the 'old school' approach especially when programming Access using VBA.
Extended Objects in Access The first section covered the essentials and once mastered users can consider extending Microsoft Access object a little further and be more explicit in adding a type of use for an object.
For example, Access Forms are screen interfaces that end-users will interact with but the types of uses for a form will vary from main input or read only form to a dialog box (pop-up) and a message box.
To help expand on this, the following list maybe extended to help identify and group types of use for various Access objects:
- frm = main form
- fdlg = dialog form
- fmsg = message form
- fsub = subform
- fmnu = menu form
- What about the other main objects? Well, here's some more:
- tbl = main table
- txls = Excel table link
- todb = ODBC table link
- ttxt = Text file link
- tsql = SQL table link
- qry = main query
- qapp = append query
- qupd = update query
- qmak = make table query
- qdel = delete query
- qxtb = cross tab query
- rpt = main report
- rsub = sub report
- mod = main module
- bas = main standard module
- cls = class module
As long as you keep it consistent and other users work with you, then your own code of working practices will pay dividends in the long-term.
Source...