Professional Documents
Culture Documents
Handout: 1
In this series of four handouts we will provide information to help you get started using Microsoft Access. This program has many capabilities and these handouts only provide a brief introduction!
1.
February 2004
Page 2
2.
Select Blank Database under New in the Task Pane to the right of the screen. In the PC Labs, browse to your U: drive (My documents folder), and name the database Assets.mdb Click Create.
2.
Under Objects, select Tables Double-click on Create table in Design view OR click on New in the toolbar and select Design View and OK. The first table will hold information on employees. We will use Social Security number as the employee ID and this will be the primary key for this table. A primary key uniquely identifies each record in a table and can be used to link tables. Enter the first field name: EmployeeID Select the data type: Text From the menu, select Edit Primary Key Or right-click on the field and select Primary Key from the floating menu. Remember that numeric fields are those on which you could do a computation, such as addition or subtraction. Social Security numbers are text fields that consist of numbers.
February 2004
Page 3
2.
Enter the rest of the fields shown here. Note that the field Description is optional, but can come in handy later when someone else takes over your database or to remind you of your design decisions. In this table, we will use Text, Currency, Date/Time, and Memo field types. Click on the x to close the table. Save it as Employees Click OK.
Adding Input Masks It is helpful for some fields to have predefined input masks to guide data entry. Select the table Employees and click on Design in the toolbar. Click on the Field Name EmployeeID Under Field Properties at the bottom of the screen, click into the box Input Mask Then click on the pop-up menu button with three dots. Click Yes when asked to save the table.
February 2004
Page 4
2.
Biology Mathematics
English Sociology
History
Page 5
2.
Close the Employees table. Creating the Assets Table: Double-click on Create table in Design view Create the fields as shown above. Set your Primary Key. Use the Lookup Wizard for the field EmployeeID to lookup first and last names of employees to whom each asset is assigned. Save the table
February 2004
Page 6
2.
Note that the AssetID field is created using the Lookup Wizard and it consists of three fields AssetID, Serial Number, and Description as shown below.
Enter the data into the table: 11223344 12/3/03 Lost internet connection Replace Ethernet card Not Complete $75
Information Technology Services
Page 7
3.
Access
The Import Spreadsheet Wizard starts. Note the worksheet is selected and the data appears in the correct columns. Click Next.
Accept the default that the First Row Contains Column Headings. Click Next.
Choose In an Existing Table Select Employees from the dropdown list. Click Next. Import to table: Employees Click Finish. Open the Employees table & view the data.
Information Technology Services February 2004
Page 8
4.
Understanding Relationships
We have created several relationships among our tables by using the Lookup Wizard to define some of our fields. To see these relationships in graphical form, from the menu select Tools Relationships. If needed, drag and move the boxes to get a clear view. It should look something like this. Close the relationships window.
5.
February 2004
Page 9
6.
Simple Queries
One of the best ways to view data in Microsoft Access is by using Queries. A Query is a specialized searching tool, similar to Find, except that you do not need to redefine the search each time you run it. Click on the Queries button under Objects Select Create query by using wizard in the listed options. Select New in the toolbar at the top of the window.
In the New Query window: Choose Simple Query Wizard Click OK.
Click on the drop down box and select Table: Employees In Available Fields select LastName Click the arrow button to add it to Selected Fields. Do the same for FirstName and Phone. Click Next
Accept the suggested title: Employees Query Click Finish. View your resulting query.
February 2004
Page 10
7.
or type =
February 2004
Page 11
7.
Note that the order of the fields listed determines the order in which the sort will occur. Return to Design View and select FirstName as the first field, then LastName. See how the sort is now by first name and then last name.
Creating a Query from Scratch Double-click Create query in Design View The Show Table window will appear. Select Employees Click Add Click Close. In the Query window click into the first field and select Department from the drop down menu. In the next fields select LastName, FirstName, and Phone. Sort ascending in Department, LastName, and FirstName. Close and save the query as Departments Query. Double click on the query to see the results.
Note: Under Table, Employees was automatically entered because the information comes from one table.
February 2004
Page 12
7.
Other examples of query criteria To specify a time period between two dates: Between #11/1/99 And #11/15/03# To specify a field with a blank in it: To specify a range: Like [A-D]* To exclude a value: Not Like 372* To specify a range: >=N To specify a range: <N To specify by specific positions: Left([Phone],3)="931"
February 2004
Page 13
8.
Getting Help
One of the easiest ways to get help with Microsoft Access is the comprehensive online help included with it. From the menu, select Help Microsoft Access Help
For example, click on the Answer Wizard tab and type examples of expressions to find information on this topic. Should you have a question that the online help does not address, please contact the Microcomputer Support Office: MicroSupport@tntech.edu Students may call the Helpdesk at 372-3975 or get assistance in the PC labs in person. Handouts on using other programs are available on the web under ITS Documentation: http://www.tntech.edu/its/pubs/
February 2004