| Software development in Microsoft Access is | | | | types that make up Microsoft Access, each of the |
| relatively simple and almost anyone can do it but if you | | | | objects has its own prefixes. A list of those prefix |
| want to be taken seriously by professional database | | | | names you should be using for the Access Object |
| developers then there are some mandatory rules that | | | | Types are shown below -db - Databasetbl - |
| you must follow whilst developing your database. One | | | | Tablesqry - Queriesfrm - Formsrpt - Reportsmcr - |
| of the first aspects professional developers will look at | | | | Macrosmdl - Modules |
| when reviewing your work will be the naming | | | | One of the key reasons we name our tables and |
| standards you are using for your Microsoft Access | | | | queries with a prefix is that when you are working |
| Objects. Microsoft Access allows you to use, what is | | | | with these two object types in the query window, |
| considered in the professional database development | | | | Microsoft Access simply lists all tables and queries |
| world, poor naming standards. For example in your field | | | | together without differentiating them. By using the tbl |
| names, you can have spaces however in the | | | | and qry prefixes on these two objects, it always |
| professional world that is a major no no. | | | | ensures that the tables are shown first and then the |
| One of the reasons we don't use spaces in Microsoft | | | | queries because t comes before q. |
| Access is that when you start creating complex | | | | Other objects that need to be named include the |
| queries and functions that refer to fields, if you have | | | | bound and unbound controls found on forms and |
| spaces in the field names it is possible to put two | | | | reports. When you create a form or report using the |
| spaces into the field name but it only appears that | | | | wizard or AutoForm or AutoReport each of the |
| there one space. What this means is that your query | | | | controls are named the same as the field names. Now |
| won't work and can sometimes take many days to | | | | whilst this is by default, it is not really an acceptable |
| find the mistake. The key issue is that you must never | | | | way of naming controls. One of the key reasons we |
| use spaces in your field names, database names or | | | | don't want to do this is that sometimes when we are |
| any of the seven different object types. There are in | | | | working with forms and reports we want to refer to |
| fact two ways that you should be naming your fields, | | | | the control rather than the field. By having the field |
| database names and so on. | | | | names the same as the object names, you can often |
| Naming Fields | | | | have a situation where the wrong control is referred |
| Let us say for instance you wanted to create a field | | | | to. The way we overcome this, is by naming our |
| to store the Postcodes for the suburbs your | | | | controls based on the control type. For example if our |
| customers live in. We could write this field in two ways, | | | | field was called fldPostcode and the control we are |
| the first thing you must do for fields is to add the prefix | | | | using for this field is a text box, then we would name |
| fld at the start of the field. Then add the field name as | | | | the text box txtPostcode. Below is a list of prefixes |
| required -fldPostcode or fldPost_code | | | | for the forms and report objects.frm - Formsrpt - |
| Either technique is quite acceptable. If you were | | | | Reportslbl - Lablestxt - text boxescmd - command |
| developing a field for Post Codes, that is codes on | | | | buttonslst - List Boxescmb - combo boxesopt - option |
| posts, then the recommended way for writing the field | | | | buttonsole - ole objectschd - Child Objects (Subforms |
| name would be -fldPostCode or fldPost_Code | | | | or subreports) |
| You will notice that in the second example the second | | | | For a full list of all prefix names that you should be |
| word is in capitals rather than in lower case. The use | | | | using in Microsoft Access Development is shown |
| of capital letters signifies that each word represents a | | | | below: |
| separate aspect of the field, so in this case the code in | | | | Microsoft Access Objectsdb - Databasetbl - |
| capitals means you are referring to codes on posts. | | | | Tablesqry - Queriesfrm - Formsrpt - Reportsmcr - |
| The same naming principles apply to database names, | | | | Macrosmdl - Modules |
| and each of the seven Microsoft Access object | | | | Table Objects -tbl - Core Data Storetmp - For |
| types. | | | | temporary Tablesbck - Tables that you have backed |
| Naming Tables | | | | up |
| When naming tables, there are three prefixes that you | | | | Forms & Reports Objects -frm - Formsrpt - |
| can use. The first prefix tbl is used for the core tables | | | | Reportslbl - Lablestxt - text boxescmd - command |
| you will be storing your good data in. The tmp prefix is | | | | buttonslst - List Boxescmb - combo boxesopt - option |
| used for tables that will be storing temporary data. It is | | | | buttonsole - ole objectschd - Child Objects (Subforms |
| also recommended that you import your data into a | | | | or subreports) |
| temporary table before inserting the data into your | | | | Report Names -rpt - For General Reportscht - For |
| good data tables. We do this for two core reasons; | | | | Chart Reportslbl - For Label Reports |
| the first is that testing your data in a temporary table is | | | | Variables -str - stringsole - ole object typesint - |
| much easier than doing it on the fly while you are trying | | | | integersdec - decimaldte - dates |
| to import your data. | | | | Module Objects -sub - Subroutinesfn - Private |
| The third table prefix I recommend being used is bck | | | | Functionspfn - Public Functions |
| for backup tables. The key advantage of using these | | | | Using the naming standards shown above will assure |
| prefix's on your tables is that Microsoft Access will | | | | that if you do require assistance from a professional |
| automatically group them by the prefix, which means | | | | database developer that they will take you far more |
| you will keep all your good tables together, your | | | | seriously than before because you have shown a |
| temporary tables together and your backup tables | | | | professional understanding on how to name your |
| together. | | | | database object. This will certainly give you credibility in |
| Naming the Seven Access Object Types | | | | the eyes of professional database developers. |
| When you are working with the seven different object | | | | |