340 likes | 358 Views
Microsoft Access 2002. Tutorial 4 – Creating Forms and Reports. Create a form using the Form Wizard. You can create a form from scratch or you can create a form using the Form Wizard.
E N D
Microsoft Access 2002 Tutorial 4 – Creating Forms and Reports New Perspectives on Microsoft Access 2002 Tutorial 4
Create a form using the Form Wizard • You can create a form from scratch or you can create a form using the Form Wizard. • The Form Wizard will lead you through a series of choices to help you develop the form based on a table or a query. • You will need to select the type of layout you want for your form, the style of the form, and a name for the form. • After you have selected the table or query on which the form will be based, you will select which field(s) will be used on the form. New Perspectives on Microsoft Access 2002 Tutorial 4
Open the Form Wizard dialog box To open the Form Wizard, click Forms in the Object Bar of the Database Window, click the New button, and then click Form Wizard. This figure shows the first Form Wizard Dialog Box. In this dialog box you select a table or query on which to base the form. You then choose which fields you want to include on the form. New Perspectives on Microsoft Access 2002 Tutorial 4
Use Form Wizard to choose a form layout The second Form Wizard dialog box allows you to choose a form layout. Click an option button to select a layout type. This panel shows a sample of the layout type you have selected. New Perspectives on Microsoft Access 2002 Tutorial 4
Use Form Wizard to select a style for the form The third Form Wizard dialog box allows you to select a pre-formatted style for your form. Click on a style to select it. View a sample of the selected style here. New Perspectives on Microsoft Access 2002 Tutorial 4
The final Form Wizard dialog box In the final Form Wizard dialog box, you specify a name for your form. You can elect to open the form to view data, or to modify the form’s design. New Perspectives on Microsoft Access 2002 Tutorial 4
Change a form's AutoFormat • You may want to change the appearance of a form after it has been created with the Form Wizard. • Clicking on the AutoFormat button and then make your selection. • Click the button beside each format to view a sample of that particular format. • Once you have decided on a format, click OK. New Perspectives on Microsoft Access 2002 Tutorial 4
A completed form created with the Form Wizard To change the form’s appearance, click the AutoFormat button. New Perspectives on Microsoft Access 2002 Tutorial 4
The AutoFormat dialog box See a sample of your selection. Click an AutoFormat name in the formats window. Select or deselect attributes using the check boxes. New Perspectives on Microsoft Access 2002 Tutorial 4
Find data using a form • You can navigate through all the records in a form, but you may want to find a particular record more quickly. • The Find command allows you to specify the record you want to see and then will navigate directly to that record. • To use the Find command: • Place your cursor in the form on the field for which you want to search • Press the Find button and enter the value you are looking for • The form will display the record(s) that match your Find criteria. New Perspectives on Microsoft Access 2002 Tutorial 4
Setting up a Find operation Position the cursor in the EmployerID field, and click the Find button. Enter the search criteria here. Choose your search options here. New Perspectives on Microsoft Access 2002 Tutorial 4
Using wildcard characters in a Find You can enter an exact match for a Find, or you can use any of the wildcard characters shown in the figure if you want a range of values or if you do not know the entire value you are looking for. New Perspectives on Microsoft Access 2002 Tutorial 4
Preview and print selected form records • Access allows you to print your forms. • Each printout page will contain as many records as can fit on a page. • You can specify how many records you want to print: • You can print just one record • You can print a range of records • You can print all the records New Perspectives on Microsoft Access 2002 Tutorial 4
The Print Preview window shows how form records would look when printed If you choose to print all the records, they will be printed down the page as shown in this figure. New Perspectives on Microsoft Access 2002 Tutorial 4
Maintain table data using a form • Not only can you view your data in a form, you can also make modifications to the data right in the form. • Once you have navigated to the record you want to change, you can make your changes. • When you move off the record, the changes are made directly to the table. • Access will allow you to add, modify, and delete records in forms view. New Perspectives on Microsoft Access 2002 Tutorial 4
A form in editing mode This figure shows a form in editing mode, meaning that changes are being made to the data on the form. When you edit data in a form, it updates the underlying table as soon as you move to another record. It is important that the database location is available throughout the time you are working with the database. For example, if the database is stored on a diskette, the diskette must be in the drive at all times. New Perspectives on Microsoft Access 2002 Tutorial 4
Add and Delete records in Form view • In addition to making changes to a record in the form, you can also delete an entire record. • The deletion is made immediately and you will not be able to recover that record once it is deleted • Always approach deletions of any kind with caution • Records can be added using a form as well. To add a record: • Click the New Record button on the form view toolbar • A blank form will appear. Enter the new data values for the new record New Perspectives on Microsoft Access 2002 Tutorial 4
Check the spelling of table data using a form • You can use the Spelling feature of Access to check the spelling of the data in your table. • The Spelling feature will look for any words that are not in the Access dictionary. • The Spelling feature works exactly like the Spelling feature of other Microsoft applications. • It is possible to change the way the Spelling feature works by changing its options in the Options dialog box. • For example, you can choose another language for the Spelling feature • You can also add words to the dictionary in the Options dialog box. New Perspectives on Microsoft Access 2002 Tutorial 4
The Spelling dialog box When the spelling feature locates a word that is not in its dictionary, it will display a dialog box that looks like the figure below. The word that is potentially in error is displayed here. Choose an alternate word or ignore the word. New Perspectives on Microsoft Access 2002 Tutorial 4
Spelling dialog box options • Notice that the misspelled word is displayed in the top text box and some suggestions appear below the word. You can: • Select one of the suggestions • Type your own change into the misspelled word box • Chose to ignore the word • Add the word to the dictionary • If you press the Change button, the suggested or selected text will be placed in the document. • If there is a word you use on a regular basis, consider pressing the Add button to add that word to the dictionary. New Perspectives on Microsoft Access 2002 Tutorial 4
Create a form with a main form and a subform • You can create a form with a subform on two tables that have an established relationship. • When the relationship between the tables is a one-to-many relationship, the main form will consist of data from the primary table and the subform will consist of data from the related table. • By selecting two related tables in the Form Wizard, you can produce a form with a subform. • The form with subform is a great way to display data for tables that have a one-to-many relationship. New Perspectives on Microsoft Access 2002 Tutorial 4
Form Wizard Form/Subform dialog box Tables or queries used for the form and subform display here. Main form fields are shown here. Subform fields are shown here. New Perspectives on Microsoft Access 2002 Tutorial 4
Form and subform data • Notice in the following figure that the main form contains information about the employer whose ID is 10122. • The data in the subform are positions that this particular employer has available. • Also notice that you have two sets of navigation buttons. You can navigate the data for either form. • The outer navigation buttons apply to the main form • The inner navigation buttons apply to the subform New Perspectives on Microsoft Access 2002 Tutorial 4
An example of a Form with subform The main form name appears in the title bar. The subform. The main form. The subform navigation bar. The main form navigation bar. New Perspectives on Microsoft Access 2002 Tutorial 4
Create a report using the Report Wizard • You can easily create a formatted printout of data in table(s) in a database by using the Report Wizard. • The Report Wizard will ask you a series of questions to help you format the report. • Once the report has been created, either with the Report Wizard or your own design, you can change the design later. • You will find that the choices you make in the Report Wizard are similar to the choices in the Form Wizard. • Choices include grouping and sorting options, as well as report layout options. You can preview the report to view how it will look when printed. New Perspectives on Microsoft Access 2002 Tutorial 4
Grouping report data You should decide how you want the report to be grouped. This figure shows a sample report (in the Report Wizard) that is grouped by the Employer table. The secondary table is the Position table. This will develop a report where each employer's position is grouped under that employer. New Perspectives on Microsoft Access 2002 Tutorial 4
Sorting report data • You can sort the data on a particular field or on several fields. • If you choose to sort on two or more fields, the grouping is in order as selected on the Sort Order portion of the Report Wizard. • If you choose to sort on State and then on City, the report would be sorted on State and then within each State group, the data would be sorted on City New Perspectives on Microsoft Access 2002 Tutorial 4
The Report Wizard Sort dialog box You can sort on multiple fields. Click the list arrow for each list box to select the fields to be used as sort keys. You can choose ascending or descending order for each sort field you select. New Perspectives on Microsoft Access 2002 Tutorial 4
Choose a report layout Report Wizard will ask you to select the layout of the report. Click an option button for one of the layout styles, and a sample appears in the pane on the left. You may want to try out several examples and view the final report to see how each one looks; you can always change the layout of the report later. New Perspectives on Microsoft Access 2002 Tutorial 4
Insert a picture in a report • You can insert a picture into a report to improve its appearance. • The picture can be from scanned images, images created in Microsoft Paint, or a picture created in some other graphic program. • Once the picture is inserted into the report, you can move it around and size it to your preference. New Perspectives on Microsoft Access 2002 Tutorial 4
Insert a picture • The picture you insert must be created before you try to insert the picture. • Be sure you know where the picture is located on your disk before you begin to insert the picture. To insert the picture: • Click Insert on the menu bar • Select Picture from the drop-down menu • Navigate to the location of the picture and select it • Press the OK button to insert it New Perspectives on Microsoft Access 2002 Tutorial 4
Moving a picture in a report This report shows a picture inserted into the report. Notice that the figure indicates that this picture is in the wrong place. Pictures are easily moved around simply by selecting them with the mouse and then dragging them to the desired position. New Perspectives on Microsoft Access 2002 Tutorial 4
Preview and print a report • Before printing the report, you can view it in Print Preview by pressing the Print Preview button. • If the preview looks OK, you can print the report. To print the report: • Click the File menu, and then click Print • In the Print dialog box you can: • Print the entire report • Print a selected number of pages • Set other printing options such as number of copies New Perspectives on Microsoft Access 2002 Tutorial 4
Preview your report before printing it Use the Print Preview option to see if the report is as you want it to be. If not, make your changes and use Print Preview again. New Perspectives on Microsoft Access 2002 Tutorial 4