Database Object Naming
Home ] Access - Start Here ] Excel In Depth ] MS Office ] Visio Info ] Creating Web Pages ] Technical References ] Viruses ] Points of View ] Gadgets ] Just Links ] Monash ]

   Search this site or the web       powered by FreeFind
 
  Site search Web search

Participate in Ananda's Discussions
Post a message

Monitor page
for changes
    
   it's private  

by ChangeDetection

Up

General Note

  1. Naming conventions should Hungarian in style or similar to Leszynski-Reddick.
  2. Naming conventions should be consistent throughout a project and obvious.
  3. Names should not have spaces and are recommended not to have underscores.
  4. Names should be ProperCase to ease readability - e.g.  StudentId
  5. Disused objects pending deletion should be prefixed with z
  6. New objects for very temporary use can be prefixed with underscore (forces sorting to the top when sorted in order of object names.

Disallowed Characters in Names

Character Description
. dot
! bang
[ ] square brackets
( ) round brackets
' single quote
" double quote
  space

Name Prefixes

Object Prefix
Table tbl
Query qry
Form frm
Report rpt
Access Macro mcr
Standard Module bas
Class Module cls

Table names

  1. Should be prefixed.
  2. There are often two types of tables - static reference tables and active tables of records. It is encouraged that reference table names incorporate tblRefListOf as the prefix.

Query names

  1. Should be prefixed.
  2. Optionally can have extended Hungarian to denote type
Type Prefix
Data Retrieval qrysel
Row Deletion qrydel
Data Update qryupd
Row Append qryapp
Make Table qrymkt
  1. Optionally can have number suffix to denote sequence of execution in a process that requires a long list of queries to be run.

Form names

Should have frm prefix - if using the Access Form Wizard to create a form, preferred way is to save the form as frm... and subsequently change the content in the Title textbox as well as the Caption property.

Report names

Should have rpt prefix - if using the Access Report Wizard to create a report, preferred way is to save the report as rpt... and subsequently change the content in the Title textbox as well as the Caption property.

Field names

  1. Should not have tablename prefix. e.g. OrdersOrderID is not necessary since the full pathname will be tblOrders.OrderID already.
  2. Should not have Hungarian prefix - makes it hard to read.
  3. For typical names like "Name", "ID" effort should be made to resolve this to more specific names as "PersonName", "PersonID"
  4. Where possible, the fields with the same content should be standardised across all relevant tables. e.g. PersonID should be across tables instead of PersonID, StudentID, etc...

Control Names

  1. If the form / report is built using an Access Wizard, the control names are generated by the wizard to be replicas of the recordsource fields.
  2. Controls generated using the Access Control Wizard should be properly named during the generation sequence.
  3. There is NO need to change the names from what the Wizard generated IF the control is not used to event trigger execution or be itself manipulated by automation.
  4. if the Control IS to be manipulated or is used as an event trigger, it should be named properly.
Object Tag Example
Chart (graph) cht chtSales
Check box chk chkReadOnly
Combo box cbo cboIndustry
Command button cmd cmdCancel
Frame (object) fra fraPhoto
Label lbl lblHelpMessage
Line lin linVertical
List box lst lstPolicyCode
Option button opt optFrench
Option group grp grpLanguage
Page break brk brkPage1
Rectangle shp shpNamePanel
Subform/report ctl ctlContact
Text box txt txtLoginName
Toggle button tgl tglForm