• No results found

Creating Tables and Queries in MS Access

N/A
N/A
Protected

Academic year: 2021

Share "Creating Tables and Queries in MS Access"

Copied!
20
0
0

Loading.... (view fulltext now)

Full text

(1)

02/23/2006 05:59 PM MS Access: Getting Started Guide

Page 1 of 20 http://www.cse.ucsc.edu/classes/ism050/Fall05/guide/guide1.html

Creating Tables and Queries in MS Access

These screenshots and steps are from MS Office 2003. Other versions should be similar.

Creating and populating a table in MS Access

.

1 Launch MS Access .

2 Select File > New and then Blank Database... from the New File side menu.

.

3 Name and save your database. .

(2)

02/23/2006 05:59 PM MS Access: Getting Started Guide

Page 2 of 20 http://www.cse.ucsc.edu/classes/ism050/Fall05/guide/guide1.html

.

(3)

02/23/2006 05:59 PM MS Access: Getting Started Guide

Page 3 of 20 http://www.cse.ucsc.edu/classes/ism050/Fall05/guide/guide1.html

The Data Type you select depends on the format of data for this field. If you need more help with data types, press F1.

.

6 Create a table with the following fields: Make, Model, Price and Discount (either as two separate fields or one), MPG (you may want to do City and Highway depending on your data), Seating (how many passengers it holds), Towing Option, and Cargo Space (you may want to do Min Cargo and Max Cargo depending on the format of your data). When you are done click the Close box.

(4)

02/23/2006 05:59 PM MS Access: Getting Started Guide

Page 4 of 20 http://www.cse.ucsc.edu/classes/ism050/Fall05/guide/guide1.html

.

7 Click Yes when prompted "Do you want to save changes to the desing of table 'Table 1'?" Choose an appropriate name for the table.

(5)

02/23/2006 05:59 PM MS Access: Getting Started Guide

Page 5 of 20 http://www.cse.ucsc.edu/classes/ism050/Fall05/guide/guide1.html

.

(6)

02/23/2006 05:59 PM MS Access: Getting Started Guide

Page 6 of 20 http://www.cse.ucsc.edu/classes/ism050/Fall05/guide/guide1.html

.

(7)

02/23/2006 05:59 PM MS Access: Getting Started Guide

Page 7 of 20 http://www.cse.ucsc.edu/classes/ism050/Fall05/guide/guide1.html

.

(8)

02/23/2006 05:59 PM MS Access: Getting Started Guide

Page 8 of 20 http://www.cse.ucsc.edu/classes/ism050/Fall05/guide/guide1.html

.

(9)

02/23/2006 05:59 PM MS Access: Getting Started Guide

Page 9 of 20 http://www.cse.ucsc.edu/classes/ism050/Fall05/guide/guide1.html

.

(10)

02/23/2006 05:59 PM MS Access: Getting Started Guide

Page 10 of 20 http://www.cse.ucsc.edu/classes/ism050/Fall05/guide/guide1.html

.

(11)

02/23/2006 05:59 PM MS Access: Getting Started Guide

Page 11 of 20 http://www.cse.ucsc.edu/classes/ism050/Fall05/guide/guide1.html

.

14 Your form will open. You can now fill in the information for each automobile. After you finish with one record, click the right arrow, or Next button to enter the next record. When you are done you can use the other arrow buttons to check your data.

(12)

02/23/2006 05:59 PM MS Access: Getting Started Guide

Page 12 of 20 http://www.cse.ucsc.edu/classes/ism050/Fall05/guide/guide1.html

.

15 After you have finished inputting all the records click the close button. .

16 Repeat these steps to create the table for the results of your department survery.

In this case you should make a field for your department name and then one field for each question/response in your survey.

If you allowed ranges as a response, do one field for the min and a second field for the max value of the range You can also make fields for the needs of the department as listed in the project description.

You may want a field for your recommendation (which can be filled out later).

(13)

02/23/2006 05:59 PM MS Access: Getting Started Guide

Page 13 of 20 http://www.cse.ucsc.edu/classes/ism050/Fall05/guide/guide1.html

Creating queries in MS Access

A "query" is a search condition you apply to your data. For the following examples, the tables below will be used:

.

(14)

02/23/2006 05:59 PM MS Access: Getting Started Guide

Page 14 of 20 http://www.cse.ucsc.edu/classes/ism050/Fall05/guide/guide1.html

.

2 You will be prompted for which tables to show. Select the table of your automobiles then click Add. That is the only table we need to see now so then click Done.

(15)

02/23/2006 05:59 PM MS Access: Getting Started Guide

Page 15 of 20 http://www.cse.ucsc.edu/classes/ism050/Fall05/guide/guide1.html

.

(16)

02/23/2006 05:59 PM MS Access: Getting Started Guide

Page 16 of 20 http://www.cse.ucsc.edu/classes/ism050/Fall05/guide/guide1.html

In the Field: box you select the field you which to search on.

In the Table: you would specify which table the field is from. Since we are only using the Autos table in this

example this will be filled in automatically.

Select a value in the Sort: box if you wish to sort the results on the field you selected.

Select Show: if you want this field to be visible in the query results. In Criteria: specify the criteria you are searching on.

Or: is used to specify ranges

.

4 Build your query: here is the example query I built to search for autos for Dept1 in my table above. This will display the

Make, Model and Price of all cars with Seating >= 4 and MPG >= 25. Notice how I do not specify any criteria for Make,

Model or Price. This means the results will not be filtered on those fields. Also, notice that the Seating and MPG fields will not show in my results.

(17)

02/23/2006 05:59 PM MS Access: Getting Started Guide

Page 17 of 20 http://www.cse.ucsc.edu/classes/ism050/Fall05/guide/guide1.html

.

5 Save your query. I called mine Dept1 since it searches based on the criteria from the first department. .

(18)

02/23/2006 05:59 PM MS Access: Getting Started Guide

Page 18 of 20 http://www.cse.ucsc.edu/classes/ism050/Fall05/guide/guide1.html

.

(19)

02/23/2006 05:59 PM MS Access: Getting Started Guide

Page 19 of 20 http://www.cse.ucsc.edu/classes/ism050/Fall05/guide/guide1.html

.

8 Experiment with other search criteria including the use of the "or" condition. You should be able to use greater than (">") and less than ("<") criteria to extract ranges on MPG, etc.

.

9 Repeat these steps for each query you wish to make and run .

10 Note that the you can later access the results of each query by selecting Queries under Objects and then opening the

(20)

02/23/2006 05:59 PM MS Access: Getting Started Guide

Page 20 of 20 http://www.cse.ucsc.edu/classes/ism050/Fall05/guide/guide1.html

If you have any questions about citations or using citations in MS Word please email me: [email protected]

This guide was created based on Shivkumar Shivaji's database guide for previous offerings of ISM 50. More advanced material can be collected from http://www.teachers.ash.org.au/jfuller/access/access2000.htm

References

Related documents

Students’ and teachers’ long-term (i.e. three years) experiences in three classes of the traditional direct instruction and constructivist class discussion approach to the

It has the capacity for an additional 0,4 meters vertical range and 2,4 meters maximum lens height addition... The speed box is mounted on the front part of the 1 st

This essay considers a body of textual/photographic work, the sequence of poems by British poet Clare Best Self-portrait without Breasts (2011) and her collaboration with

Your contacts access public address books and contact data fields by using the “ Want to unsubscribe or change your details?” link that you should put in your email campaigns. To

Before creating a table in this way not only do you need to know what fields are needed in the table, but also what sort of data they will hold, what rules the data has to follow

The first dialog box of Form Wizard allows you to select one or more tables on which your form is based and select the fields of that table to be included in the form..

Note, for example, the second page of our report after creating it with the Report Wizard, using our previously created query that included a new field called Total

Critical levels and associated error rates were estimated for each sampling dates for the following plant and soil N indicators: (i) petiole NO 3 -N concentrations (dry weight basis),