Exp19_Access_Ch04_Cap – Foodies Forms And Reports 1.2
You will create a form so that users of the database can enter and edit suppliers of products to your business easily. You create an attractive report that groups the products that you purchase by their suppliers, and then export it to PDF format for easy distribution. Finally, you create a Navigation Form so that database users can switch between major objects in the database readily.
You will create a form to manage the data in the Suppliers table. Use the Form tool to create the form, and then modify the form as required. You will also remove the layout control from the form so that the controls can be repositioned freely.
Select the Suppliers table as the record source for a form. Use the Form tool to create a new form with a default layout.
Change the form’s title to Enter/Edit Suppliers. Change the width of the text box controls to approximately 3.4″.
Delete the Products subform control from the form. View the form and the data in Form view. Sort the records by CompanyName in ascending order.
In Layout view, set the background color of the CompanyName text box to Blue, Accent 1, Lighter 80%, and set the font size to 14. Save the form as . Close the form.
Open the Edit Suppliers form in Design view. Select all controls in the Detail section of the form, and then remove the layout. View the form in Layout view. If necessary, arrange the fields on the form one below the other in the following order: SupplierID, CompanyName, ContactName, ContactTitle, Address, City, Region, PostalCode, Country, Phone, and Fax. Ensure that the left edges of the labels and the text boxes align. Delete the Contact Title label from the form and move the text box up and to the right of ContactName so that their top edges are aligned.
Delete the Country label from the form and move the text box up and to the right of PostalCode so that their top edges are aligned. Move the Phone and Fax labels and text boxes up to below PostalCode so that they close in the white space, keeping the spacing close to that of the rest of the controls.
View the form in Print Preview and set the orientation to Landscape. Switch to Form view, and then save and close the form.
You will create a report based on the Company by Product List query. You decide to use the Report Wizard to accomplish this task. You are planning to email a copy of the report to your business partner who is not conversant in Access, so you will export the report as a PDF file prior to sending it.
Select the Company by Product List query in the Navigation Pane as the record source for a report. Activate the Report Wizard and use the following options as you proceed through the wizard steps:
Select all of the available fields for the report. View the data by Suppliers. Accept the default grouping levels and click Next. Use ProductName as the primary sort field in ascending order.
Accept the Stepped and Portrait options. Save the report as Products by Suppliers.
Switch to Layout view and apply the Organic theme to this report only. Set the width of the ProductCost label to approximately 0.8″ so that the entire text of the label is visible. Switch to Report view to determine whether all the columns fit across the page. Switch to Layout view and drag the left edge of the ProductName text box to the left so that the column width is wide enough to display the values in the field (approximately 2.5″).
Delete the ContactName label and text box from the report. Drag the right edge of the CompanyName text box to the right so that the column width is wide enough to display the values in the field (approximately 2.6″). Save the report.
Switch to Print Preview and export the report as a PDF file named ProductsbySuppliers. Close the reader program that displays the PDF report and return to Access. Close Print Preview. Close the report.
You realize that the Country field was not included in the query that is the record source for your report. You add the field to the query and then modify the report in Layout view to include the missing field.
Open the Company by Product List query in Design view. Add the Country field from the Suppliers table to the query design grid, after the ProductCost field. Run, save, and close the query.
Open the Products by Suppliers report in Layout view. Add the Country field from the Field List pane by dragging it into the report layout. Click the selection handle at the top of the Country column and move the column immediately to the left of the Phone field. Resize the Country text box so that the column width is wide enough to display the values in the field (approximately .75″). Switch to Print Preview, then save and close the report.
You will create a Navigation Form so that users can switch between objects in the database readily.
Create a Vertical Tabs, Left Navigation Form.
Drag the Edit Suppliers form icon from the Navigation Pane onto the [Add New] tab at the left of the form.
Drag the Products by Suppliers report icon from the Navigation Pane onto the second [Add New] tab at the left of the form. Save the Navigation form with the default name, Navigation Form.