Check out our website! www.nvcc.edu/woodbr idge/computer-lab Contact Us Location: Open Computer Lab Seefeldt Building #336 NOVA Woodbridge Campus Hussna Azamy (OCL Supervisor) Phone: 703-878-5714 E-mail: hazamy@nvcc.edu Hamna Chaudhri (OCL Trainer) Phone: 703-878-5713 E-mail: hchaudhri@nvcc.edu Copyright 2014: Northern Virginia Community College - Woodbridge Open Computer Lab
2
Introduction: Microsoft Access is a database management application used to store and analyze data. It also allows the user to create reports and forms. Opening Access 2013: Go to start menu and type Access in the search box. From the options, choose your desired template or click on blank desktop database to create a blank database. Name the database, then click on Create. Terminology: Field: In MS Access, a field is a column in a table Record: In MS Access, a record is a row in a table Cell: A cell is the intersection between a field and a record Creating a Table: Click on the Create Tab Table A blank table will appear where you may begin to create fields and add records Adding a Field: Right click on Click to Add and select the type of data that you would like the new field to store. Renaming a Field: Right click on the field and select rename option from the menu. 3
Adding Data: To add data to a table, simply click on a cell and type the desired data. Working with Views: There are two views available for a table: Datasheet View and Design View Datasheet View: Provides a tabular view of the data. You can add, edit, or delete records using this view. Design View: Provides a more detailed view of the table structure. This view allows you to make changes to the structure of the table (i.e. change the data type of a field, make a field required etc.) To select a view, click on Home tab View choose the desired view Saving, Closing, and Opening a Table: Besides saving your Access file, you will also need to save each object of your database. An object can be a table, a report, a query, or a form. In order to save an object, right click on the object select save type a name for the object and click on save. 4
Closing an object: Right click on the opened object and select close Opening an object: On the navigation pane located to the left side of the screen, you will see a list of all saved objects. Double click on the desired object to open it. Sorting: Select a field you wish to sort by. Click the Home Tab locate the Sort and Filter group sort the field by selecting the Ascending or Descending command. Forms: Forms ensure you re entering the right data in the right location and format. To create a form click on Create tab Form Wizard follow the instructions and click on finish to create the form 5
Queries: Queries allow the user to analyze data stored on a database. A query displays only data that meets the specified criteria (i.e. only display the names of the students above 40 years old) To create a query, click on Create tab Query Wizard A New Query window opens, select the simple query option and then click Ok. Click open if a security warning window is displayed Next, select your criteria In this example we would like the query to display only the Name field of the table Double click on the name field to move it to the selected fields section, then click next On the next screen, type a title for your query and click on Finish Reports: Reports are generally used for creating a printer friendly version of the desired information in a database To create a report for an entire table or query, select the object from the navigation pane and click on Create Tab Report 6
You may also create a report with data that meets a specific criteria similar to a query. In this case, you will click on Create Tab Report Wizard follow the instructions on the wizard screen, and click on finish to create your report 7
8
Changing a Table Structure: To change a table structure, switch to Design View (Home tab View Design View) To change the data type of a field, click on the current data type listed in front of the field name and select the desired data type from the drop down menu The available data types include but are not limited to short text (255 characters or less), long text (more than 255 characters long), Number, Date/Time, and currency. You can make further changes to the field properties by using the Field Properties panel. Field Size: Caption: Default Value: Specify the length of the filed Add a caption to the field Add a default value to the field Validation Rule: Provide validation criteria for a field (i.e. age must be between 18-60) Validation Text: Required: Displays an error message if a value that does not meet the validation criteria is entered. Indicates if it is a required field or optional. Customizing a Report: You can customize a report using the following 4 tabs Design: Use this tab to add images, logos, and other elements to your report Arrange: Use this tab to add or remove columns, rows, and cells of a report Format: Use this tab to change the color of the text, the fill color of the boxes, and the font type and size of the report text. 9
Page Setup: Use this tab to make adjustments to page margins, orientation, and columns Below is an example of a customized report: Creating a Form using Design View: Click on Create tab Form Design On the Filed List section, click on show all tables if necessary Click on the + sign next to each table to display its fields Click and drag the desired field to the form design area Similar to reports, you can customize the form by using the following 3 tabs: o Design: Use this tab to add images, buttons, text boxes, and other elements to your form o Arrange: Use this tab to add or remove columns, rows, and cells of a form o Format: Use this tab to change the text color, text font and size, and the fill color of the cells. You may also add a background image using this tab. Adding Buttons to a Form: Click on Design Tab and select button option from the Controls group Drag your mouse pointer to draw the button Once you are finished drawing the button, the Command Button Wizard will automatically open up 10
Select the desired command for the button (i.e. go to the next record, delete a record etc.) then click next. On the next window, type a name for the button and click Finish Click on Format Tab Quick Styles to apply a style to your button Adding Background Image: Click on Format Tab Background Image and browse to the location where the desired image is saved to insert it to your form. Following is a sample form created using the Form Design option 11
Creating a Complex Query using Design View: Click on Create tab Query Design Under Design tab, select table names option if it s not selected already to view the tables On the Show Table window, select the tables that you would like to use for your query and click on Add button Specify the criteria for the query at the bottom section of the query design screen In this example, the names and ages of all the students who are 40 years or older will be displayed. Notice that the query wil be sorted by age in ascending order. 12
Using Math Functions for Query Criteria: To use math functions such as sum, average, minimum, maximum etc. use the following steps: Click on Totals option on the Design tab Notice that another row is added to the query table Click on the Group By menu to select the desired function Once you are finished specifying your query criteria, click on run option on the Design tab Following is the executed query which displays the name and age of all students who are age 40 or above. 13