|
Up
| |
General Note
- Naming conventions should Hungarian in style or similar to Leszynski-Reddick.
- Naming conventions should be consistent throughout a
project and obvious.
- Names should not have spaces and are recommended not to have underscores.
- Names should be ProperCase to ease readability - e.g. StudentId
- Disused objects pending deletion should be prefixed with z
- 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
- Should be prefixed.
- 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
- Should be prefixed.
- 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 |
- 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
- Should not have tablename prefix. e.g. OrdersOrderID is not necessary
since the full pathname will be tblOrders.OrderID already.
- Should not have Hungarian prefix - makes it hard to read.
- For typical names like "Name", "ID" effort should be made to resolve this
to more specific names as "PersonName", "PersonID"
- 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
- 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.
- Controls generated using the Access Control Wizard should be properly
named during the generation sequence.
- 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.
- 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 |
|