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