Drivers and Insurance
In this project, you will add fields to a table and set data validation rules. You will also import a text file into a database, design advanced queries, and create a navigation form. Additionally, you will use SQL to modify a record source and create an embedded macro to automate opening a report.
For the purpose of grading the project you are required to perform the following tasks:
Start Access. Open the file named exploring_a_capstone_grader.accdb. Save the database as exploring_a_capstone_grader_LastFirst .
Create a table in the database by importing the downloaded delimited text file named Insurance_Text.txt. Use the first row of the file as field names, use InsuranceID as the primary key, and then name the table InsuranceCos_Text . Accept all other default options. Do not save the import steps.
Create a new field in the Agency Info table after InsPhone named Web site with the Hyperlink data type. Save the table. In Datasheet view, add the Web site http://William_Smith.com to the
William Smith record (1).
Create a new field in the Agency Info table after Web site named AgentPhoto with the Attachment data type. Save the table. In Datasheet view for Record 1 (William Smith), add the downloaded picture file named a00c2WmSmith.jpg to the AgentPhoto field.
Set the validation rule of the InsuranceCo field to accept the values AS , NAT , or SF only. Set the validation text to read Please enter AS, NAT, or SF. (include the period).
Make InsuranceCo a lookup field in the Agency Info table. Set the lookup to get values from the InsuranceID field in the InsuranceCos_Text table. Accept all other defaults and save the table. In Datasheet view, click in any InsuranceCo cell and click the arrow to view the options. Close the table.
Create a new query using Design view. From the Insurance table, add the DriverID, AutoType, TagID, and TagExpiration fields (in that order). Save the query as Missing Tag Dates .
Set the criteria in the TagExpiration field to find null values. Run the query (two records will display). Save and close the query.
Create a new query using Design view. From the Drivers table, add the Class field. Change the query type to Update and set the criteria to update drivers whose class is Minor to Junior . Run the query (eight records will update). Save the query as Driver Class_Update and close the query. View the updates in the Drivers table and close the table.
Create a new query using Design view. From the Drivers table, add the Class field. Save the query as Driver Class_Delete .
Change the query type to Delete and set the criteria to delete drivers whose class is Special . Run the query (one record will delete). Save and close the query. View the changes in the Drivers table and close the table.
Create a new query using Design view. From the Insurance table, add the DriverID, AutoType, AutoYear, and TagID fields (in that order). Save the query as Auto Year_Parameter .
Set the criteria in the Auto Year field to display the prompt as Enter the auto year: and run the query. In the prompt, enter 2007 and click OK to view the results (two records). Save and close the query.
Use the Performance Analyzer to analyze the Drivers table. Note the idea to change the data type of the Weight field from Short Text to Long Integer. In the Drivers table, set the data type of the Weight field to Number (Long Integer) and save and close the table.
Create a Navigation form based on the Vertical Tabs, Left template. Drag and drop the Drivers form onto the first tab of the form. Drop the Insurance form onto the second tab.
Drag and drop the Drivers report onto the third tab of the Navigation form. View the form in Form view, click each of the tabs, and then save the form as Navigator . Close the form.
Open the Drivers report in Design view. Modify the record source of the report using a SQL statement to select all Drivers records with a Class of Adult. Print Preview the report (eight records will display). Save and close the report.
Open the Drivers form in Design view, click to add a command button at the intersection of the six-inch mark on the horizontal ruler and the three-inch mark on the vertical ruler.
Set the command button to open the report named Drivers. Use the default picture as the button. Set the name and the caption of the button to Open Drivers Report . Save the form. View the form in Form view and click the command button.
Close all database objects, close the database, and then exit Access. Submit the database as directed.