16
Making Database. Making Queries. Making Forms

Tutorial access 2003

Embed Size (px)

Citation preview

Page 1: Tutorial access 2003

Making Database.Making Queries.

Making Forms

Page 2: Tutorial access 2003

2. In the section to the right of the screen, click on the Blank Database option:

The File New Database dialog box comes up:

1. Start Access 2003 by selecting it from the Windows Start Menu. Access shows up:

Page 3: Tutorial access 2003

3. The database will be stored on a computer as a file. Browse to the directory where you want tosave the database file; also type in the file name of your choice in the File Name textbox. Inthis tutorial you will name the file volunteer.mdb. Then click on the OK buttonAfter you have created the new file, you are ready to manipulate the database:

Page 4: Tutorial access 2003

4. Double click the Create table in Design view link on the top center of the screen. You will seea new form:

Creating Your First Table Field

1. Now you will add each field to the table structure on this form, starting with first name. Click onthe first blank textbox in the Field Name column:

2. Type First_name in the Field Name column:

Page 5: Tutorial access 2003

3. Tab to the next column titled Data Type. This is a drop down list containing the data types thatyou can choose from. Since the first name will contain alpha letters, the data type that bestsuits it is Text, which you will select from the drop down list:

At the bottom of the form, there are additional options that you should pay attention to:

Page 6: Tutorial access 2003

5. The Required property specifies whether a value is required to be entered in this field whenyou add a new record. In this case, we do need the first name of each volunteer, so changethe value to Yes.Filling in the appropriate values—to create the rest of the fields: last name, social security number (SSN),phone number, and birth date.

4. The Field Size property specifies the maximum number of characters the field can hold. Leavethe value to the default of 50.

Page 7: Tutorial access 2003

Creating Rest of the Fields

1. For the last name field, you will choose the same Data Type, Field Size, and Required valueas you did for the first name field. When you have filled in all the properties for last name, theform should appear as shown below:

Page 8: Tutorial access 2003

2. Create the SSN field as such:a. Field Name: SSNb. Data Type: Text (the only field that should have the data type Number is if the valuewould be required for calculation, which SSN does not quality)c. Field Size: 9 (to restrict the entry to 9 digits, which is the standard for all SSNs)d. Required: Yes

Page 9: Tutorial access 2003

3. Create the phone number field as such:a. Field Name: Phone_numberb. Data Type: Text (the only field that should have the data type Number is if the valuewould be required for calculation, which phone number does not quality)c. Field Size: 50d. Required: No (perhaps not all volunteers have a phone number)

Page 10: Tutorial access 2003

4. Create the birth date field as such:a. Field Name: Birth_dateb. Data Type: Date/Timec. Required: Yes (there may be a law that dictates only people over age 14 mayvolunteer)

Page 11: Tutorial access 2003

Defining Primary Key and Saving the Table

Follow these steps to make SSN your primary key:

1. Highlight the SSN row in the Table Creation form:

2. Right click anywhere in this row, and select the Primary Key option:

Now the SSN field will have a key to the left:

Page 12: Tutorial access 2003

3. Next, click on the Close button of the Table Creation form (not the Close button of the Accesswindow!).

5. Name the table Volunteer and click OK.

4. You will be asked if you want to save the table. Click Yes. Now you will be given theopportunity to name the table:

Page 13: Tutorial access 2003

1. Double click on the Volunteer table, which takes you to the table with no data yet:

2. Enter the following values in the first record:a. First name: Johnb. Last name: Smithc. SSN: 999999999d. Phone number: 395-433-3443e. Birth date: 1/23/1990

Editing the Database Table

Now that you have created the Volunteer table, you can add to or edit its content:

Page 14: Tutorial access 2003

4. For the second record, enter all of the same data as you did with the first record. When youfinish and try to click outside the record, you get an error message stating that you haveentered duplicated data in the Primary Key:

3. Click on the next record; notice that since we entered all valid data, no error message wasencountered.In the following steps, you will enter invalid data into the fields. Note how Access performserror checking:

Page 15: Tutorial access 2003

6. Enter more invalid data into the second record. This time, enter valid data for all fields exceptBirth date, for which you will enter 12/35/2000. Because December does not have a 35th day,Access will return an error message stating the date entered is not valid:

5. Click OK and Press the Escape key on the keyboard to clear the second record.

Page 16: Tutorial access 2003

7. Click OK and Press the Escape key on the keyboard to clear the bogus value in the Birth datefield.8. Enter any valid date for the Birth date field.9. Close the table, which automatically saves any change made since opening the table.10. Your Finished