Leszynski/Reddick Naming Conventions For Microsoft Access


Why it's a good idea to follow these standards

First of all, the standard calls for you to use a tag in front of the name depending on the object type, e.g. "qry" for a query, "tbl" for a table, etc. Imagine a table called "Supplier" and a query called "Suppliers" that selects and sorts in such a way that the resulting recordsets of both objects will be different (as the query uses a restrictive criteria). OK, you can remember now that the query has an 'S' on the end of its name but what about in 6 months time when you go to build a form, Access offers you a list of tables and queries, you see "Supplier" and "Suppliers", can you remember then which is which?

Access won't allow you to name different objects with the same name but you might want to use the same base name to group objects together based on their meaning, the L/R naming standards allows this in an unobstrusive way, e.g.

tblSupplier Suppliers table
qrySupplier Suppliers query
frmSupplier Suppliers form
rptSupplier Suppliers report.

As you'll notice, the tags are in lower case and the main part of the name is in Proper case, your eyes are automatically drawn to the first capital letter (S in this case) so it's easy to read the name "Supplier" in all cases, even though each word starts with a different sequence of letters.

I won't go on and on about it here but will leave you with an explanation of why the naming standards database doesn't cover the naming of columns within a table.
Quite simply, Dr Codd (in his rules on relational databases) states that a column (or field, if you like) should be independant of type. This becomes obvious when, for example, you name a column "lngSupplierCode" to depict a supplier code that is numeric (long integer in this case), somewhere down the line, someone will decide that the supplier code should be alphanumeric for some reason or another. It's bad enough having to change the data type in all tables where this appears (probably just the one table if it's not the primary key of the supplier), but to have to go around and change all references to it in queries, forms and Access Basic Code in order to change the first 3 letters of its name it just too much and potentially error prone.


The L/R Naming Standard For Access Verison 2.0                   

Tags for Database Container Objects                         
                                                            
Form                       frm                  frmCustomer                            
Form (dialog)              fdlg                 fdlgLogin                              
Form (menu)                fmnu                 fmnuUtility                            
Form (message)             fmsg                 fmsgWait                               
Form (subform)             fsub                 fsubOrder                              
Macro                      mcr                  mcrUpdateInventory                     
Macro (menu)               mmnu                 mmunEntryFormFile                      
Module                     bas                  basBilling                             
Query (append)             qapp                 qappNewProduct                         
Query (crosstab)           qxtb                 qxtbRegionSales                        
Query (DDL)                qddl                 qddIInit                               
Query (delete)             qdel                 qdelOld Account                        
Query (form filter)        qflt                 qfltSalesToday                         
Query (make table)         qmak                 qmakShipTo                             
Query (select)             qry (or qsel)        qryOverAchiever                        
Query (SQL pass-through)   qspt                 qsptOrder                              
Query (totals)             qtot                 qtotResult                             
Query (union)              quni                 quniMerged                             
Query (update)             qupd                 qupdDiscount                           
Query(lookup)              qlkp                 qlkpStatus                             
Report                     rpt                  rptInsuranceValue                      
Report (subreport)         rsub                 rsubOrder                              
Table                      tbl                  tblCustomer                            
Table (lookup)             tlkp                 tlkpShipper                            

Database Container Object Prefixes                          
                                                            
Archived objects           zz                   zzfrmPhoneList                         
System Objects             zs                   zstblObjects                           
Temporary objects          zt                   ztqryTest                              
Under development          _ (underscore)       _mcrnewEmployee                        

Tags for Control Objects                                    
                                                            
Chart                      cht                  chtSales                               
Check box                  chk                  chkReadOnly                            
Combo box                  cbo                  cboIndustry                            
Command button             cmd                  cmdCancel                              
Frame                      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 (shape)          shp                  shpNamePanel                           
Subform/report             sub                  subContact                             
Text box                   txt                  txtLoginName                           
Toggle button              tgl                  tglForm                                


The L/R Naming Standard For Access Verison 2.0                   
                                                                                Page 2 of 2

Tags for Access Basic Variables                             
                                                            
Container                  con                  Dim conTables as Container             
Control                    ctl                  Dim ctlVapour As Control               
Currency                   cur                  Dim curSalary As Currency              
Database                   db                   Dim dbCurrent As Database              
Document                   doc                  Dim docRelationships as Document       
Double                     dbl                  Dim dblPi As Double                    
Dynaset                    dyn                  Dim dynTransact As Dynaset             
Field                      fld                  Dim fldLastName as Field               
Flag (Y/N,T/F)             f                    Dim fAbort As Integer                  
Form                       frm                  Dim frmGetUser As Form                 
Group                      gru                  Dim gruManagers as Group               
Index                      idx                  Dim idxOrderld as Index                
Integer                    int                  Dim intRetValue As Integer             
Long                       lng                  Dim lngParam As Long                   
Object                     obj                  Dim objGraph As Object                 
Parameter                  prm                  Dim prmBeginDate as Parameter          
Property                   prp                  Dim prpUserDefined as Property         
QueryDef                   qdf (alternate: qrd) Dim qdfPrice As QueryDef               
Recordset                  rec (alternate: rst) Dim recPeople as Recordset             
Relation                   rel                  Dim relOrderItems as Relation          
Report                     rpt                  Dim rptYTDSales As Report              
Single                     sng                  Dim sngLoadFactor As Single            
Snapshot                   snp                  Dim snpParts As Snapshot               
String                     str                  Dim strUserName As String              
Table                      tbl                  Dim tblVendor As Table                 
TableDef                   tdf (alternate: tbd) Dim tdfBooking as TableDef             
Type (user-defined)        typ                  Dim typPartRecord As mtPART_RECORD     
User                       usr                  Dim usrJoe as User                     
Variant                    var                  Dim varInput As Variant                
Workspace                  wrk (alternate: wsp) Dim wrkPimary as Workspace             
Yes/No                     ysn                  Dim ysnPaid As Integer                 

Access Basic Variable Prefixes for Scope                    
                                                            
Global                     g                    glngGrandTotal                         
Local                      (none)               intCustomerld                          
Module                     m                    mcurRunningSum                         
Passed parameter           p                    pstrLastName                           
Static                     s                    sintAccumulate                         


Static s sintAccumulate