| Software development in Microsoft Access is | | | | comes before q.Other objects that need to be |
| relatively simple and almost anyone can do it but if | | | | named include the bound and unbound controls found |
| you want to be taken seriously by professional | | | | on forms and reports. When you create a form or |
| database developers then there are some mandatory | | | | report using the wizard or AutoForm or AutoReport |
| rules that you must follow whilst developing your | | | | each of the controls are named the same as the field |
| database. One of the first aspects professional | | | | names. Now whilst this is by default, it is not really an |
| developers will look at when reviewing your work will | | | | acceptable way of naming controls. One of the key |
| be the naming standards you are using for your | | | | reasons we don't want to do this is that sometimes |
| Microsoft Access Objects. Microsoft Access allows | | | | when we are working with forms and reports we |
| you to use, what is considered in the professional | | | | want to refer to the control rather than the field. By |
| database development world, poor naming standards. | | | | having the field names the same as the object |
| For example in your field names, you can have | | | | names, you can often have a situation where the |
| spaces however in the professional world that is a | | | | wrong control is referred to. The way we overcome |
| major no no.One of the reasons we don't use spaces | | | | this, is by naming our controls based on the control |
| in Microsoft Access is that when you start creating | | | | type. For example if our field was called fldPostcode |
| complex queries and functions that refer to fields, if | | | | and the control we are using for this field is a text |
| you have spaces in the field names it is possible to | | | | box, then we would name the text box txtPostcode. |
| put two spaces into the field name but it only | | | | Below is a list of prefixes for the forms and report |
| appears that there one space. What this means is | | | | objects.frm - Forms |
| that your query won't work and can sometimes take | | | | rpt - Reports |
| many days to find the mistake. The key issue is that | | | | lbl - Lables |
| you must never use spaces in your field names, | | | | txt - text boxes |
| database names or any of the seven different | | | | cmd - command buttons |
| object types. There are in fact two ways that you | | | | lst - List Boxes |
| should be naming your fields, database names and so | | | | cmb - combo boxes |
| on.Naming FieldsLet us say for instance you wanted | | | | opt - option buttons |
| to create a field to store the Postcodes for the | | | | ole - ole objects |
| suburbs your customers live in. We could write this | | | | chd - Child Objects (Subforms or subreports)For a |
| field in two ways, the first thing you must do for | | | | full list of all prefix names that you should be using in |
| fields is to add the prefix fld at the start of the field. | | | | Microsoft Access Development is shown |
| Then add the field name as required -fldPostcode or | | | | below:Microsoft Access Objectsdb - Database |
| fldPost_codeEither technique is quite acceptable. If | | | | tbl - Tables |
| you were developing a field for Post Codes, that is | | | | qry - Queries |
| codes on posts, then the recommended way for | | | | frm - Forms |
| writing the field name would be -fldPostCode or | | | | rpt - Reports |
| fldPost_CodeYou will notice that in the second | | | | mcr - Macros |
| example the second word is in capitals rather than in | | | | mdl - ModulesTable Objects -tbl - Core Data Store |
| lower case. The use of capital letters signifies that | | | | tmp - For temporary Tables |
| each word represents a separate aspect of the field, | | | | bck - Tables that you have backed upForms & |
| so in this case the code in capitals means you are | | | | Reports Objects -frm - Forms |
| referring to codes on posts. The same naming | | | | rpt - Reports |
| principles apply to database names, and each of the | | | | lbl - Lables |
| seven Microsoft Access object types.Naming | | | | txt - text boxes |
| TablesWhen naming tables, there are three prefixes | | | | cmd - command buttons |
| that you can use. The first prefix tbl is used for the | | | | lst - List Boxes |
| core tables you will be storing your good data in. The | | | | cmb - combo boxes |
| tmp prefix is used for tables that will be storing | | | | opt - option buttons |
| temporary data. It is also recommended that you | | | | ole - ole objects |
| import your data into a temporary table before | | | | chd - Child Objects (Subforms or subreports)Report |
| inserting the data into your good data tables. We do | | | | Names -rpt - For General Reports |
| this for two core reasons; the first is that testing | | | | cht - For Chart Reports |
| your data in a temporary table is much easier than | | | | lbl - For Label ReportsVariables -str - strings |
| doing it on the fly while you are trying to import your | | | | ole - ole object types |
| data.The third table prefix I recommend being used is | | | | int - integers |
| bck for backup tables. The key advantage of using | | | | dec - decimal |
| these prefix's on your tables is that Microsoft Access | | | | dte - datesModule Objects -sub - Subroutines |
| will automatically group them by the prefix, which | | | | fn - Private Functions |
| means you will keep all your good tables together, | | | | pfn - Public FunctionsUsing the naming standards |
| your temporary tables together and your backup | | | | shown above will assure that if you do require |
| tables together.Naming the Seven Access Object | | | | assistance from a professional database developer |
| TypesWhen you are working with the seven | | | | that they will take you far more seriously than |
| different object types that make up Microsoft | | | | before because you have shown a professional |
| Access, each of the objects has its own prefixes. A | | | | understanding on how to name your database object. |
| list of those prefix names you should be using for | | | | This will certainly give you credibility in the eyes of |
| the Access Object Types are shown below -db - | | | | professional database developers.Chris Le Roy is a |
| Databasetbl - Tablesqry - Queriesfrm - Formsrpt - | | | | professional software developer and has been |
| Reportsmcr - Macrosmdl - ModulesOne of the key | | | | developing software applications for over 20 years in |
| reasons we name our tables and queries with a | | | | Visual Basic, VB .net, VBA, C++, Microsoft SQL |
| prefix is that when you are working with these two | | | | Server, Transact SQL, ASP, PHP and Microsoft |
| object types in the query window, Microsoft Access | | | | Access. He is the Managing Director of One-on-One |
| simply lists all tables and queries together without | | | | Personal Computer Training that trains over 2000 |
| differentiating them. By using the tbl and qry prefixes | | | | people per year across Australia and Overseas from |
| on these two objects, it always ensures that the | | | | basic Microsoft Office functionality to advanced |
| tables are shown first and then the queries because t | | | | Database Design and VBA. |