Setting up a Primary Key
1. In table design view, select the field you wish to set as the primary key. Hold the Ctrl key and click both field selectors.
2. Click the Primary Key button on the toolbar, or choose Edit – Primary Key.
3. Having finished designing the table and setting the primary key, be aware that you must save it before you can add any further records. Thus provide the table with a relevant name that describes its function or the records to be stored within it. Table names can be up to 64 characters in length and it is preferable to give them a prefix of ‘tbl’ or ‘_table’.
4. Click the tables tab on the toolbar and your freshly saved table with your naming convention will appear in the database window.
Note: Naming conventions are crucial to the cohesion of your database structure. Queries, tables, reports, forms, fields and controls all should have uniquely identifiable names that are relevant and can be understood quickly. It is important to remember these three rules when assigning naming conventions to each object of your database.
Names cannot be longer than 64 characters.
- Names cannot include full stops.
- Names cannot begin with a space.
It is a good idea to always provide objects with a descriptive name and prefix that is relevant to the task being performed. For example;
- Forms = ‘_frm’ or ‘frm’
- Queries = ‘_qry’ or ‘qry’
- Reports = ‘_rpt’ or ‘rpt’
- Tables = ‘_tbl’ or ‘tbl’