Professional Documents
Culture Documents
Beginners Guide
Contents
Overview......................................................................................................................... 3 Access Basics.................................................................................................................. 4 Database Window ....................................................................................................... 4 Opening a Sample Database ....................................................................................... 4 The Menu Bar ............................................................................................................. 6 Toolbars ...................................................................................................................... 7 The Objects Bar .......................................................................................................... 9 Help........................................................................................................................... 11 Closing a Database.................................................................................................... 12 Quitting Access......................................................................................................... 12 Creating Databases and Tables ..................................................................................... 13 Creating a Database from a Template....................................................................... 14 Creating a New Blank Database ............................................................................... 19 Opening an Existing Database .................................................................................. 20 Creating a Table Using a Wizard.............................................................................. 21 Creating a Database Table from Scratch .................................................................. 24 Displaying a Table in Design View .......................................................................... 27 Adding a New Field .................................................................................................. 28 Changing a Field Name ............................................................................................ 28 Setting a Field's Data Type ....................................................................................... 29 Setting the Field Size for a Text Field ...................................................................... 30 Setting the Field Size for a Number Field ................................................................ 31 Adding a Field Description....................................................................................... 33 Deleting a Field......................................................................................................... 33 Setting the Primary Key............................................................................................ 34 Saving the Data Table............................................................................................... 35
Overview
Microsoft Access is a database program that enables you to store information such as a client list, product list, music libraries, and other collections of data. In addition to entering the data in a database table, you have several tools for working with the data. You can create forms for simpler data entry. You can create a query to display a set of records (all customers with overdue balances, for instance). You can create a report. All these elements are Access objects and are stored together in the database. A database is a collection of information that's related to a particular subject or purpose, such as tracking customer orders or maintaining a music collection. If your database isn't stored on a computer, or only parts of it are, you may be tracking information from a variety of sources that you have to coordinate and organise yourself. For example, suppose the phone numbers of your suppliers are stored in various locations: in a card file containing supplier phone numbers, in product information files in a file cabinet, and in a spreadsheet containing order information. If a supplier's phone number changes, you might have to update that information in all three places. In a database, however, you only have to update that information in one place, and the supplier's phone number is automatically updated wherever you use it in the database. One useful point to understand about Access is that you can work in two views for most objects: Design view and Working view. Think of Design view as viewing the technical drawings of a house, whereas Working view is the house itself. In Design view, you can see how the underlying structure creates that object, and you can make changes to the layout. In Working view, you can view and work with your data using the structure you created in Design view. Working view varies depending on the object type. For instance, when working with tables, the view is called Datasheet view. When working with queries, you see the results of the query. Each element in a database table is called a field and has a field name and data type. One set of fields is a record. Although you can make modifications to a database design after you've entered records, you may lose data or encounter a few problems. Therefore, it's a good idea to carefully think about and plan your database structure. Which fields are needed? How do the fields relate? Do I need to break down a field into smaller elements? For instance, it's not a good idea to include one field for a person's name. Instead, include a first name field and a last name field. This setup makes sorting and searching easier. When you are entering data, you do not need to save your work. Access saves the work automatically. When you create or modify an object such as a database table, form, or report, you do need to save your changes. Rather than store all your data in one large database table, you can break down the information into separate tables and then set up relationships between the tables. For instance, rather than have a table that includes products, orders, and customer names, you can include separate tables for each and then link them.
Access Basics
To use Access youll need to learn the basics of how the screen looks. If youve used other Microsoft Office products before you will notice some similar toolbars and menus. There are however many unique options that only appear within Access and if youve never used Access before it can be a bit daunting the first time you load the program to know what to do next. Microsoft includes a sample database called Northwind, that will give you an idea of how a database works, as well as seeing how to use tables, queries, forms, and reports.
Database Window
Help command
Tables button
Access toolbar
Objects toolbar
Tables toolbar
Database window
Figure 1
Status bar
An overview of the database window within Access 2003
3. The Northwind database opening screen appears; click OK to close this screen and display the Northwind database. Figure 3
The Northwind database opening screen appears when opening the database. To prevent this from appearing again click on the Dont show this screen again option
4. The Main Switchboard dialog box opens. Click the Close button in the upper-right corner of the dialog box to close it (as shown in Figure 4). Figure 4
The main switchboard of the Northwind database which is a well designed and easy to use screen, especially if youre new to using Access
5. The database window for the Northwind sample database opens. The next pages show you how to navigate around Access by using this sample database.
Figure 5
This is a typical database window where you can access the Tables, Queries, Reports and so on
Click the File option in the menu bar and then select Open. The Open dialog box opens (as shown in Figure 7). Here you can select the folder that contains the file you want to open, and then the file. Click Cancel to close the dialog box without opening a file. Figure 7
The Open dialog box where you can browse your hard disk or network for available databases that you can open
Toolbars
In addition to selecting commands from menus, you can perform common actions using the buttons on the toolbar. The toolbar has buttons you can click to create, delete and change how objects are viewed. You can use the toolbar buttons to configure the way you view your database objects. For example, to change how objects are displayed in the database window, click the Large Icons button to view the table list entries as large icons (as shown in Figure 8). Figure 8
You can change the way Access shows your objects. In this example they are being shown as Large Icons
Click the Small Icons button, located next to the Large Icons button, to view the table list entries as small icons (as shown in Figure 9). Figure 9
You can change the way Access shows your objects. In this example they are being shown as Small Icons
Click the List button, next to the Small Icons button, to view the table entries in a simple list format (as shown in Figure 10). Figure 10
You can change the way Access shows your objects. In this example they are being shown as the List view
Click the Display button next to the List button, to view the details of each table in the list, including its description, size, and modification date (as shown in Figure 11).
Figure 11
You can change the way Access shows your objects. In this example they are being shown in Details view, which is the same as List view but also has a description, modified and created date and the type of object
To open any of the listed tables, double-click its name. For instance, double-click the Categories entry to open the Categories table.
The Categories table opens. The names at the top of each column identify the data, and each row is a record (as shown in Figure 13). Figure 13
When opening a table you can fill in the records as required
Close the Categories table by clicking the Close button in the upper-right corner of the table window. At the bottom of the Categories table you will see a Record field. This is very helpful when you have a vast amount of entries within the table, as you can scroll through by using the buttons, or type in the record number in the number box to go straight to that entry. Well now see the difference by opening up a different option on the Objects bar. This time well select one of the forms by clicking on Forms. A list of forms in the open database appears, as well as commands for creating new forms. To open any of the listed forms, double-click its name. For example, double-click the Customers form. Figure 14
To open any of the available forms you can either double-click on the selected form or select it and then click on Open on the toolbar
10
The Customers form is opened. To close the form, click the Close button in the upper-right corner of the form window. Figure 15
The Customers form is opened and is a visually better way of entering records
There are other options available within the Objects menu, such as Queries and Reports. You open queries and reports in the same way you do forms and tables: by clicking the Queries or Reports button in the Objects bar, and then choosing the query or report you need.
Help
Access includes an easy-to-use Help system. One way to access Help is to type a question in the help box found on the right side of the menu bar; another is to use the Help menu. The following example will use the Help feature and show you how to use this. In the help box on the menu bar, type create reports and press Enter. A Search Results task pane opens, displaying Help topics that contain the search phrase you just. Click the Create a report entry. A window containing the Help information opens. Read the information in the window, and click the Close button in the window's upper-right corner to close it. Figure 17
When you click on an option from the task pane an information window appears with help on the selected item
Figure 16
Type in what you would like help with in the help box on the menu bar and then a list of results appears below in a task pane
11
Closing a Database
When you are finished working with a database, you can close it. Doing so frees up memory for other programs you may have open. Keep in mind that you can close a database, but still keep Access open. A database window has its own Close button. To close an open database, click the Close button in the upper-right corner of the database window (as shown in Figure 18). Figure 18
To close any database window you can click on the X in the top right-hand corner
The database window and database are closed. When you close your database this is automatically saved, unlike other Microsoft Office applications that prompt you if you would like to save the changes. The only time you are prompted to save your work upon closing a database is when structural changes, such as the creation of an object, have been made to that database.
Quitting Access
To close Access, click the Close button in the upper-right corner of the program window. If you prefer to use menus, you can also exit Access by clicking on the menu and selecting Exit. File Figure 19
To quit Access click on the X in very top right-hand side of the screen
12
Primary key
Figure 20
An overview of what creating a table in design view looks like
Field size
Field properties
13
The Templates dialog box opens, displaying the templates installed on your computer. Click the Databases tab (as shown in Figure 22). Figure 22
Selected the desired Database template from the available list
14
Click the template you want to use and click OK. The File New Database dialog box opens (as shown in Figure 23). Navigate to the folder in which you want to store the new database. In the File name field, type a filename for the new database. Click the Create button. Figure 23
Type in a file name in the File name box and save the database on your computer
The Database Wizard starts; after you review what types of data the new database will contain, click the Next button. Figure 24
The Database Wizard will show you what your database will store
15
A list of the tables included in the new database appears. Click each table in the Tables in the database list to view the available fields for that table. If you are certain that your database doesn't require a particular field, click the check box next to the field in the Fields in the table list to deselect it. After you have deselected any fields you do not want to include, click Next. Figure 25
Select the fields that you would like to include in the table by ticking the boxes
The wizard presents a list of styles that affect how data in your database is displayed onscreen. Click a style to preview it. When you find one you like, click Next. Figure 26
Select the style you would like the screens to be displayed in
16
The Database Wizard prompts you to select a style for your reports (as shown in Figure 27). Click a style to preview it. When you find one you like, click Next. Figure 27
You can select from six different styles how you would like your reports to appear
Access suggests a title for the new database. If you want, type over the suggested title with one of your own. To include a picture on your reports (such as a company logo), check the Yes, I'd like to include a picture check box and then click the Picture button. Navigate to the drive and folder that contain the picture file, click the picture to select it, and click OK. When you're satisfied with the title and picture selection (if required), click Next.
Figure 22
One of the last steps is to name your database. You can also include a picture if you wish that will be displayed
17
Leave the Yes, start the database check box checked, and click Finish to create the database (as shown in Figure 29). Figure 29
Once you have selected all of the options you can have the wizard automatically start the database
The Main Switchboard window for the new database appears. You can select any of the links in the window, such as Enter/View Contacts, to continue building your database. When you use a template, Access displays the Main Switchboard that enables you to click links to perform common database tasks. Click the window's Close button to close it and use the database window instead. Figure 30
The Main Switchboard will now load and you can select the desired option from the choices available
18
In the New area of the New File task pane, click the Blank database link. The File New Database dialog box opens (as shown in Figure 32). Navigate to the folder in which you want to store the new database. Type a descriptive name for the new database in the File name field. Click the Create button. Figure 32
Type in the name of the Database then click on the Create button
19
Access creates a new database and displays the database window. You will now have to create the objects for this new database. Figure 33
When you create a new database you will have to create the objects and can do this in the three ways shown
Figure 34
Select the database you wish to open and then click on Open
20
The database window for the selected database opens (as shown in Figure 35). Figure 35
Once you have opened the database you will go to the Database window when you can view your Objects
21
The first screen of the Table Wizard opens (as shown in Figure 37). Click either the Business or the Personal option button to specify how your database will be used.
Figure 37
Select the desired fields that you wish to use in your table from the list available
The Sample Tables list contains available sample tables for the table type you selected earlier. Click the type of table you want to create. The Sample Fields list shows you all the available fields in the selected sample table. Click the first field you want to include in your table, and click the Add (right arrow) button. Figure 38
To select a field, click on it in the Sample Fields list and then click on the right arrow to add it to your list
The field is added to the Fields in my new table list. Repeat this step adding all the desired fields to your table until it contains all the fields you want to include.
22
Click the Next button. Type a name for the table in the What do you want to name you table? field. Figure 39
Type in a name of your table and you can also select whether or not to let the wizard set a primary key for you
Access asks whether you want the wizard to set the primary key for you; the default setting is Yes, set a primary key for me. Keep this option selected and click Next. The wizard prompts you to select the next action; the default setting is Enter data directly into the table (as shown in Figure 40). Keep this option selected and click Finish. Figure 40
After the wizard has created the table you are then prompted how you would like to proceed
The new database table is created and displayed onscreen, ready for you to begin entering records (as shown in Figure 41).
23
Figure 41
If you left the last step as Enter data directly into the table you will be taken to the Datasheet view of the table when you can start entering records
24
A blank table opens in Design view, containing Field Name, Data Type, and Description columns. In the Field Name column, type a name for the first field and then press Tab. To change the data type from the default, Text, click the down arrow in the Data Type field and choose a new data type from the list that appears. Then press Tab. Figure 43
Start to type in the fields as required, typing in a field name and data type. You can use the drop-down list to select from the different types of data types
You must use a unique name for each field in your table, and it's a good idea to use descriptive names that remind you of the contents of that field. A field name can include as many as 64 characters. You can type a field description in the Description column although this is optional and not required. It does however help when working with many fields to have a brief description of what each field is for. This text appears in the Table window's status bar when you are entering data and this field is selected. Once you have finished entering your first field, you can then enter all other fields, setting the Field Name, Data Type and Descriptions as required.
25
Figure 44
An example of a completed table in Design view
To save the table, open the File menu and choose Save. The Save As dialog box opens (as shown in Figure 45). Type a name for the table and click OK. Figure 45
After completing the fields, click on the File menu and then select Save. Type a name in the Table Name box
Access prompts you to set a primary key. Click No to set the primary key later. Figure 46
You will be prompted to select a primary key or to set one later
The table is saved, and the name you typed in the Save As box above appears in the table window's title bar. To close the table window and return to the database window, click the Close button. Figure 47
To close the table click on the X in the top right-hand corner of the design view
26
Figure 49
You will now go to the Design view where you can add or amend current fields
27
The table is open in Design view, enabling you to make changes to the database structure.
Type a name for the field and press Tab. To change the data type from the default, Text, click the down arrow in the Data Type field and choose a new data type from the list that appears. Then press Tab. You can also type a field description in the Description column. This text appears in the Table window's status bar when you are entering data and this field is selected. Figure 51
The new field has now been created and you will need to save this table to see these changes
Click the Save button on the Standard toolbar in the main Access window to save your changes to the database table.
28
If you do not like the name you assigned a field, or if a default name assigned by the Table Wizard doesn't suit your needs, you can easily change a field's name. After you've opened the table you want to modify in Design view, click in the Field Name column for the field you want to change. Figure 52
You can rename any field name as required. Just select the field you wish to rename and overtype the current name
Select the field's current name and then type over the selection with the new field name. Figure 53
The name has now been changed. To keep these changes you will need to save the table
The field's name is changed. Click the Save button on the Standard toolbar to save the changes to the table.
29
Figure 54
To change a Data Type click on the drop-down arrow and select the desired option
Choose a new data type from the list that appears. The field type is changed. Click the Save button on the Standard toolbar in the main Access window to save the changes to the table. If you have already entered data in the table, changing the field type may result in the loss of your entries. If so, Access will duly notify you, enabling you to choose to make or cancel the change.
30
The lower half of the table window shows the properties of the selected field, the first of which for text fields is Field Size. Click the Field Size text box. Type the number of characters you want the text field to allow. Figure 56
The text data type has now been changed to 8 characters
Click the Save button on the Standard toolbar to save your changes to the database table. You can change the field size of text and number fields only. Other field types have a default size, which you cannot change.
31
Figure 57
On all Data Types that are set to Number you can select the type of number. The default is Long Integer
The lower half of the table window shows the properties of the selected field, the first of which for number fields is the Field Size. Click the Field Size text box. Click the down arrow that appears in the Field Size text box and select a field size from the list that appears. Figure 58
From the available list in the Field Size you can select the desired option
32
Click the Save button on the Standard toolbar in the main Access window to save your changes to the table.
Click the Save button on the Standard toolbar to save your changes to the table.
Deleting a Field
If your database includes fields that you do not need, you can delete them. Keep in mind, though, that if you have already entered data into the table, you will lose all the entries in the field you deleted.
33
After you've opened the table you want to modify in Design view, click the field selector (the leftmost column of the table) for the field you want to delete. A right-facing arrow appears (as shown in Figure 61). Figure 61
To delete a field you need to open this in Design view and then highlight the field you wish to remove
The field is selected. Click the Delete Rows button on the Standard toolbar in the main Access window (as shown in Figure 62). Figure 62
Click on the Delete Rows button on the Standard toolbar to delete this entry
The field is deleted. Click the Save button on the Standard toolbar to save the changes to your table.
34
Figure 63
Click on the field you wish to set as your Primary Key
Click the Primary Key button on the Standard toolbar (as shown in Figure 64). Figure 64
Click on the Primary Key button on the Standard toolbar
Access adds a key icon to the field to indicate that it is the primary key (as shown in Figure 65). Click the Save button on the Standard toolbar to save your changes to the table. Figure 65
Once you have clicked on the Primary Key you will notice a key symbol appear next to your row
If you let Access create the primary key for you, it creates an AutoNumber field that is incremented for every new record you create.
35
the Save toolbar button, or the Save shortcut key (pressing the Ctrl and S keys together). If you close the table without saving, Access prompts you to do so. Figure 66
You will be prompted if you wish to save the changed to the design of the table
After you make changes to a table's structure, open the File menu and choose Save. The database table is saved. Figure 67
Click on the File menu and then click on Save to save the changes made to the table structure
36