Professional Documents
Culture Documents
To Create a new database container: Check off Blank Access database. The next screen display (presented below) will appear once you clock OK (bottom right corner). To modify an existing database: Check off Open existing file and Select the database, if shown in the window, if it is not there Open the database with the normal File Open menu that will be presented on the next screen.. Click OK when done
Note: If you use the File Open or File new command to accomplish the same. Access needs the drive, folder and database name to continue. See below. The screen below requires you to provide the necessary data to enable Access to save your database container on the proper drive and folder with an appropriate file name.
Access notes. Author: Leo Kerklaan - McGill University Montreal, PQ, Canada Page 1 of 16
November 1999
Select the drive and folder. Under File name: Give your database a proper name. Unless you give it a name, Access will sequential number a database Db1, Db2 etc. for you. When done, click on Create icon.
Note: You can also use the History, My Documents, Desktop and Favorites to store your database.
Access notes. Author: Leo Kerklaan - McGill University Montreal, PQ, Canada Page 2 of 16
November 1999
The following screen is presented. The Objects area indicates you are active in Tables section. To go elsewhere click on one of the the Object name such as Queries or Reports. As this was a new database, no existing Tables, Queries, Reports and Forms will appear. Each item will have to be created. From this panel you would normally Create a new table design Modify an existing table design Open an existing table and display its content. To create a new table, click on Create table in Design view.
Note: On the table design screen, the width of the Field Name, Data Type and Description are adjustable. So too is the entire display. To adjust the width, place your pointer between any two columns and move in the desired direction. To adjust the entire image size it is best to stretch from the corners. The list of fields is scrollable.
Access notes. Author: Leo Kerklaan - McGill University Montreal, PQ, Canada Page 3 of 16
November 1999
Field Description. This is an optional field that can be up to 255 characters long. Use this to document your table structure. Field Size. Assigns maximum field length, but is only used for Text and Number fields. However you really only need to concern yourself with length for Text fields. For number fields: If a whole number like social insurance number, use Long Integer. For a value that has decimal places use Double. For more information turn to Data types and Field sizes under Access help. Format. Enables you to specify how the data is to be displayed and or printed e.g. Currency - 2 decimal places, Short or Long Date format. November 1999
Access notes. Author: Leo Kerklaan - McGill University Montreal, PQ, Canada Page 4 of 16
Chapter 2 Tables. Creating, Browsing, Importing, Linking Input Mask. Specifies how the data is be entered over a mask. Examples: (000)-000-0000. A letter or digit entry required. C any character or space, but nothing else. Caption. Label that will be used as column heading in a query and or report instead of the field name. Default value. Access will automatically insert whatever is specified. e.g. todays date (=Date()). Validation Rule. Data must meet the limitations as per specified rules. e.g. Value must not be less than $6.00. More examples follow. Validation Text. The message that will be displayed if validation rule is violated. Required. If yes then user must enter a value, i.e. field cannot be left blank. Allow zero length. If allowed, text with no length e.g. is permitted. Indexed. Maintains an index on all the values of this field to speed up searches and links. A good rule of thumb as to whether or not to assign an index is: It must be assigned to all primary key and linked fields in a relationship. If one does frequent searches and or sorts on this field. Note: If you index a field, you will be prompted as to whether or not duplicate keys are allowed. If no duplicate values are permitted then the field can be assigned a primary key. Additional Field property notes. Acceptable data entry formats are: 5/14/94, 5/14/1994, May 14, 1994, May 4, 1994, May 14. Note: 5/14/00 is assumed to be May 14, 2000. Time is entered as 16:00:00 or 16:00. All dates and times can be formatted (displayed) with a number of short and long date and time formats. Validation rules examples: <> 0 ; 10 OR 900 ; Like Montr??? ; <= #12/31/96# etc.. Null Values. If you do not type a value, Access stores a Null value in the field. Note: To seek out a null value, in the criteria cell of the query specify Null. See example in the Query chapter. Deletion of a Field in the table and the switching the order of a field from one row to another row and row depth. Deletion of a field: Any field can be deleted by 1st selecting it and clicking in the empty box just to the left of the field name. When the symbols turns to and the line highlights, double click on the Delete key. All other rows will move up. Switching a Fields location (order) in the table. Any row (field) can be moved from one location to another by simply selecting the row (click in the box just to the right of the field name until symbol turns to an ). While holding down the left mouse button move the row to its desired location. Changing the depth of a given or multiple rows. By selecting just between two rows, Access will let you stretch the depth of that row and possible the ones below.
Access notes. Author: Leo Kerklaan - McGill University Montreal, PQ, Canada Page 5 of 16
November 1999
Access notes. Author: Leo Kerklaan - McGill University Montreal, PQ, Canada Page 6 of 16
November 1999
Chapter 2 Tables. Creating, Browsing, Importing, Linking Filter icons Find icon
Sort icons Replace dialog would let you find and replace all or some of the data.
Access notes. Author: Leo Kerklaan - McGill University Montreal, PQ, Canada Page 7 of 16
November 1999
One of the simplest methods is to use the power of Copy and Paste, albeit there are limitations in terms of the amount of data that can be copied. For example, importing a table from Excel requires the following steps. In Excel, select the table. The first row should contain unique column heading. Copy this selection to the clipboard (use the Copy icon, or right mouse click and select Copy or from the Edit menu and selecting Copy). Switch to Access tables tab and Paste the table into Access (use the Paste icon or right mouse click and select Paste or from the edit menu and selecting Paste). You will be prompted for Yes No response as to whether or not your table has column headings. Respond appropriately. This will create a table named the name of the worksheet in Excel. If required, select the table and rename it to a more meaningful name (select and right click and select Rename). Open the table in design mode and fix the data types and properties to what you require them to be. Assign all foreign keys and a primary key if required.
Import method
In the method above, the data is copied and the properties are assigned in Access. Through importing one is not only able to bring in the data but also assign indexing, primary and foreign keys properties. You should still go back into Access Design and modify the imported structure but often all it entails is assigning more meaningful field length to text fields and formatting the various fields. Of course bringing in a very large table may only be possible via the importing method. Here follow the steps.
In the Tables tab, click New. This will bring up the New Table dialog. Select Import Table. Click OK Note this can also be accessed via the menu through Insert - Table.
Access notes. Author: Leo Kerklaan - McGill University Montreal, PQ, Canada Page 8 of 16
November 1999
Access notes. Author: Leo Kerklaan - McGill University Montreal, PQ, Canada Page 9 of 16
November 1999
Identify the drive & folder (Look in) at the top and File Name near the bottom (space for file name is not visible). If you are importing an Excel table be sure to identify the file type as Microsoft Excel. The dialog is displayed to the right. Click Import
On the following panel, Select either the Worksheet or the Range Name radio button, to identify where Excel has your data stored. In the example shown, I am using Range names. Specifically I am pointing at the Employee range name. With this selection it shows the data in this table. The date of birth field shows values rather than dates. This will be fixed up later trough table design and formatting.. Click on Next >
Access notes. Author: Leo Kerklaan - McGill University Montreal, PQ, Canada Page 10 of 16
November 1999
On the following panel Be sure to tick off First Row Contains Column Headings. Note: If you fail to do this, your fields will be named Field 1, Field 2 etc. By selecting this, your field names will take on the column headings on the 1st row.
On the next screen, not shown, indicate the that you would like to create a New table. Click Next.
Access notes. Author: Leo Kerklaan - McGill University Montreal, PQ, Canada Page 11 of 16
November 1999
For each field in the table that requires indexing, indicate No or Yes (duplicates OK) or Yes (No duplicates). The latter makes it a candidate for a primary key.
Access notes. Author: Leo Kerklaan - McGill University Montreal, PQ, Canada Page 12 of 16
November 1999
On this panel, select the field with the primary key or else indicate No primary key or possibly have Access create one for you. In this example, the filed No is being assigned the primary key.
Click Next >. On the next screen (not shown), Access asks you to name your table. Give it an appropriate name and click on Finish. The table will be created with all the structure, properties and data. Access will confirm that it worked or not.
Access notes. Author: Leo Kerklaan - McGill University Montreal, PQ, Canada Page 13 of 16
November 1999
Chapter 2 Tables. Creating, Browsing, Importing, Linking In the Tables tab, click New. This will bring up the New Table dialog. Select Link table. Click OK Note this can also be accessed via the menu through Insert - Table.
Access notes. Author: Leo Kerklaan - McGill University Montreal, PQ, Canada Page 14 of 16
November 1999
Chapter 2 Tables. Creating, Browsing, Importing, Linking From the next panel, Indicate the drive, folder and file name of the file to be linked. Be sure to indicate the correct file type like Access or Excel.
Click Link
From the next panel, Select the table through either the worksheet name or range names.
In the example, the range name Employee was selected. Access displays the first few records. Click Next
Access notes. Author: Leo Kerklaan - McGill University Montreal, PQ, Canada Page 15 of 16
November 1999
On the next panel (not shown), Indicate that your table contains column headings in the 1 st row. Click Next.
On the next panel (not shown), Give the table a name. Click Finish.
On the panel shown below, the tables tab shows the link to an Excel spreadsheet is shown by the Excel file type indicator to the left of the file name.
Note: Establish the relationship similar to other relationship links within Access. Of course as this creates a link to an outside the Access database container, should you be moving your database to floppy diskette will also require that all linked tables are moved as well.
Access notes. Author: Leo Kerklaan - McGill University Montreal, PQ, Canada Page 16 of 16
November 1999