ACCESS 2007 ADVANCED

Size: px
Start display at page:

Download "ACCESS 2007 ADVANCED"

Transcription

1 ACCESS 2007 ADVANCED WWP Learning and Development Ltd Page i

2 Contents CONCEPTS OF NORMALISATION...1 INTRODUCTION...1 FIRST NORMAL FORM...1 SECOND NORMAL FORM...1 THIRD NORMAL FORM...1 FOURTH NORMAL FORM...2 FIFTH NORMAL FORM...2 JUNCTION TABLES...2 ANALYSING TABLES...3 INTRODUCTION...3 USING THE TABLE ANALYSER WIZARD...3 USING THE PERFORMANCE ANALYZER...5 DOCUMENTING A DATABASE...6 Exercise - Analysing Tables...7 TRANSFERING DATA...9 INTRODUCTION...9 LINKING DATA TO AN ACCESS TABLE USING THE LINKED TABLE MANAGER EXPORTING DATA CONVERTING FILES Exercise Transferring Data DATABASE TOOLS INTRODUCTION ADDING SECURITY ENCRYPTION TO A DATABASE (PASSWORD PROTECTING) COMPACTING AND REPAIRING A DATABASE USING NAME AUTOCORRECT BACKING UP A DATABASE Exercise Database Tools DESIGNING ADVANCED QUERIES INTRODUCTION JOINING TABLES IN QUERIES CROSS PRODUCTS CREATING REVERSE OUTER JOINS USING THE CROSSTAB QUERY WIZARD USING THE FIND DUPLICATES QUERY WIZARD USING THE UNMATCHED QUERY WIZARD Exercise - Designing Advanced Queries CREATING RELATIONSHIPS INTRODUCTION CREATING A RELATIONSHIP BETWEEN TABLES SETTING REFERENTIAL INTEGRITY VIEWING SUBDATASHEETS DELETING A JOIN LINE PRINTING RELATIONSHIPS Exercise - Creating Relationships FORM DESIGN TOOLS AND METHODS INTRODUCTION SETTING THE TAB ORDER AUTOMATICALLY SETTING THE TAB ORDER MANUALLY ADDING A FORM HEADER AND FOOTER CREATING A FORM WITHOUT USING THE WIZARD CREATING A PIVOTTABLE OR PIVOTCHART VIEW Exercise Form Design Tools and Methods Page ii WWP Learning and Development LTd

3 AUTOMATING FORMS WITH CONTROL WIZARDS INTRODUCTION ACTIVATING THE CONTROL WIZARDS CREATING COMMAND BUTTONS TO CARRY OUT FORM ACTIONS CREATING COMMAND BUTTONS TO CARRY OUT REPORT ACTIONS CREATING COMMAND BUTTONS TO CARRY OUT RECORD NAVIGATION/OPERATION CREATING A COMBO BOX CREATING A LIST BOX CREATING AN OPTION GROUP ADDING A LOGIC CONTROL ACTIVEX CONTROLS ADDING AN ACTIVEX CONTROL ATTACHING AN ACTIVEX CONTROL Exercise - Automated Controls on Forms ADVANCED REPORT DESIGN INTRODUCTION CREATING A CALCULATED CONTROL GROUPING DATA IN A REPORT CREATING GROUP HEADERS AND FOOTERS CREATING A RUNNING SUMMARY INSERTING A DATE/TIME CONTROL INSERTING A PAGE BREAK CHANGING THE REPORT MARGINS CREATING A REPORT WITHOUT USING A WIZARD Exercise - Using Advanced Report Design USING CHARTS INTRODUCTION CHANGING THE CHART TYPE FORMATTING CHART OBJECTS FORMATTING THE CHART TITLE ADDING DATA LABELS TO A CHART Exercise - Using Charts USING SUBFORMS/SUBREPORTS INTRODUCTION EDITING THE LAYOUT OF A SUBFORM DISPLAYING A SUBFORM IN DATASHEET VIEW DISPLAYING A SUBFORM TOTAL Exercise - Using Subforms/Subreports WORKING WITH INDEXES INTRODUCTION CREATING A SINGLE FIELD INDEX CREATING A MULTIPLE FIELD INDEX DELETING AN INDEX CREATING A MULTIPLE FIELD PRIMARY KEY Exercise - Working with Indexes WORKING WITH MACROS INTRODUCTION CREATING A MACRO ASSIGNING AN ARGUMENT TO AN ACTION SAVING A MACRO USING SINGLE STEP MODE FOR TESTING A MACRO RUNNING A MACRO EDITING AN EXISTING MACRO RUNNING A MACRO FROM THE DATABASE TOOLS RIBBON WWP Learning and Development Ltd Page iii

4 Contents CREATING A MACRO FOR AN EVENT Exercise - Creating Macros FURTHER MACROS INTRODUCTION ASSIGNING A MACRO TO A CONTROL ASSIGN A MACRO TO A COMMAND BUTTON ADDING A CONDITION TO A MACRO CREATING A MACRO GROUP CREATING AN AUTOEXEC MACRO Exercise - Further Macros EVENTS INTRODUCTION ENSURING DATA ENTRY AUTOMATICALLY FILLING FIELDS Exercise - Events USING SWITCHBOARDS INTRODUCTION CREATING A SWITCHBOARD ADDING A COMMAND BUTTON TO A SWITCHBOARD OPENING A SWITCHBOARD AUTOMATICALLY Exercise - Using Switchboards CUSTOMISING THE QUICK ACCESS TOOLBAR INTRODUCTION ASSIGNING A MACRO TO A TOOLBAR Exercise - Customising The Quick Access Toolbar APPENDIX A - USING ACCESS AND THE INTERNET INTRODUCTION WORKING WITH HYPERLINKS CREATING A HYPERLINK FIELD INSERTING A HYPERLINK EDITING A HYPERLINK DELETING A HYPERLINK FIELD EXPORTING DATABASE OBJECTS TO HTML IMPORTING OR LINKING TO A HTML FILE USING SHAREPOINT Exercise - Using Access and the Internet APPENDIX B ADVANCED ACCESS SECURITY INTRODUCTION CREATING A DIGITAL SIGNATURE ADDING A DIGITAL SIGNATURE TO A DATABASE DIGITALLY SIGNING AND PACKAGING A DATABASE USING THE TRUST CENTER LOCKING A DATABASE LOCKING DATABASE RECORDS Exercise - Using Access Security Page iv WWP Learning and Development LTd

5 CONCEPTS OF NORMALISATION INTRODUCTION The theory of database design includes standards called normal forms. The process of arranging your data into the standards is called Normalisation or Normalising data. By normalising your database, you eliminate redundant data and organise your tables so that managing data and future changes to the structure of the database is easier. 1 In this lesson, you will learn how to: Normalise Data By normalising your database you split larger tables into smaller tables which are more manageable and easier to maintain. To work with the related data you must then reconnect the tables via relationships between common fields. Data normalisation is not specific to Access, but is part of the database design process. There are five normal forms; each addresses specific problems and each assumes the requirements of the preceding form have been satisfied. FIRST NORMAL FORM A Table is in the First Normal Form when each field contains the smallest meaningful value and the table does not contain repeating groups of fields. Tables that are not in the first normal form usually have fields containing data that can be broken down into smaller meaningful parts e.g. placing a complete name into one field instead of splitting it into first and last names. They also contain repeating groups of fields which list the same category of data in multiple fields. This can be corrected by creating separate tables for each of related values. SECOND NORMAL FORM The Second Normal Form applies only to tables with a multiple field primary key. In these tables any non key fields should relate to the entire primary key. In other words, any non key fields should be a fact about the entire primary key. Tables that are not in the second normal form usually have repeating values in a field due to the fact that the field does not relate entirely to the primary key. If a field s value depends only on part of the primary key it should be removed and placed in a separate table. THIRD NORMAL FORM The third normal form applies only to tables with a single field primary key. In these tables each non key field should be a fact about the primary key. That is a non key field should not be a fact about another non key field. Tables that are not in the third normal form usually have repeating values in a field due to the fact that the field does not relate to the primary key. If a field s value does not describe the primary key it should be removed and placed in a separate table. WWP Learning and Development Ltd Page 1

6 FOURTH NORMAL FORM A Table is in the Fourth Normal Form when there are no independent one-to-many relationships between what should be the primary key and non key fields. Tables not in the fourth normal form usually contain blanks in non key fields and duplicate values in the field you want to set as the primary key. The usual reason for this is the table has been based on two different subjects. Separate the data into two new tables each about one specific topic. FIFTH NORMAL FORM A Database is in the fifth normal form when the tables are broken down into the smallest possible tables to eliminate redundant non key fields. Usually, tables that are not in this form contain repeating values of data in the non key fields. Putting a database in this form allows you to control database integrity. Because each piece of non key data normally only appears once in the data base it is relatively easy to update the data. JUNCTION TABLES A normalised database will sometimes not contain common fields which allow you to create relationships between tables. To over come this, create a table, sometimes called a junction table, which contains the fields which can link the tables. For example if you have a table which has a list of employee numbers and names and a table which contains project numbers and descriptions, you need to create a Junction table which contains the fields for employee number and project number and use this to assign employees to projects. When designing tables there are three basic rules that you can follow to ensure a good database design. 1. Make each table only about one specific subject. 2. Each non key field should be a fact about the entire primary key. 3. Each field should contain the smallest meaningful data value. Page 2 WWP Learning and Development Ltd

7 ANALYSING TABLES INTRODUCTION When you create or analyse a table, you should look at its structure to determine the efficiency of its design. If the same information appears in multiple records, the table can probably be split into two related tables. Splitting a table is more efficient because the tables are then smaller and, as a result, easier to manage. In addition, information will only need to be entered one time. Smaller tables also reduce the chance of making data entry errors. If you feel that a table may need to be split, you can use the Table Analyser Wizard to analyse it for you and suggest which fields should be in each table. The Table Analyser Wizard can also create the correct table relationships. 2 In this lesson, you will learn how to: Analyse a table Use relationships in splits Use the Table Analyzer Wizard Use the Performance Analyzer Use the Documenter When the Table Analyser Wizard splits a table, it creates the necessary relationships in the resulting tables. These relationships allow data from all the tables to be used in queries, forms, and reports. USING THE TABLE ANALYSER WIZARD The Table Analyser Wizard looks at a table to determine if it contains duplicated information. If the Table Analyser Wizard determines that a table has a lot of duplicated data, it splits the table, creating new tables and leaving the original table intact. When the Wizard is open, you select the table you want to analyse. On subsequent pages, you indicate whether you want the wizard to decide how to split the table or whether you want to do it yourself. If you allow the wizard to split the table, the recommended tables and the relationships between them appear. You can then move fields between tables or even drag fields to create new tables. Each piece of information should be stored in only one location, and each table should contain only data that refers to a single subject. Once the fields have been put into the correct tables, you can set the primary keys. In order to be related properly, each table must have a primary key, and the primary key must be a field that uniquely identifies each record. Therefore, a primary key field cannot contain duplicate data. Access will generate unique fields, if necessary. WWP Learning and Development Ltd Page 3

8 To analyse the design of tables, first open the database you wish to investigate. Click on the Database Tools tab. Click on the Analyze Table button. Read the first two explanatory pages, clicking on the Next button each time. Click on the table you want analysed. Click on the option for the Wizard to decide regarding field locations. Click on the Next button. Rename the tables. Click on the Next button. Choose whether to specify primary key(s). Click on the Next button. Set corrections if necessary. Click on the Next button. Choose whether to accept the query. Click on the Finish button. Page 4 WWP Learning and Development Ltd

9 USING THE PERFORMANCE ANALYZER The Performance Analyser analyses the efficiency of your database in order to optimise its performance. The Performance Analyser window contains a page for each available object type in Access, as well as a Current Database page and an All Object Types page. The Current Database page allows you to analyse features that are not objects, such as relationships. You can analyse a single object or multiple objects on different pages. If you are analysing different types of objects, the All Object Types page allows you to view all database objects in one location. The results of the performance analysis appear in the Analysis Results box. The results are categorized as a Recommendation, Suggestion, or Idea. The Analysis Notes box provides additional information about the selected result. You can use the Optimise button to have Access perform the action suggested in a Recommendation or Suggestion; you must manually perform the action for an Idea. After you have selected the Optimise button, the Performance Analyser marks the action as Fixed. To optimize database performance, first open the database you want to optimize. Click on the Database Tools tab. In the Analyze group, click on the Analyze Performance button. In the Performance Analyzer, select the object(s) you want analyzed. Click on the OK button. Click on each item and review the analysis notes. Press and hold down the [Ctrl] key while clicking on the suggested optimizations. Click on the Optimize button. Click on the Close button. WWP Learning and Development Ltd Page 5

10 DOCUMENTING A DATABASE A complex database may include many tables, queries, forms and relationships. One of the Access analysis tools is the documenter which analyses the database and can print a report of all details of the whole database. To document a database, first open the database you intend to document. Click on the Database Tools tab. In the analyze group, click on the Database Documenter button. In the Documenter dialog box, click on the items on each tab that you want documented OR Click on the Select All in the All Object Types page. Click on the Options button. In the Print Table Definition dialog box, click on the desired. After making your selections click on the OK button. Click on the OK button to start the Documenter. The Documenter will display a print preview of the report. Page 6 WWP Learning and Development Ltd

11 EXERCISE - ANALYSING TABLES 1. Open Train11x. 2. Open the Table Analyser Wizard. Select Next as needed and then select the Project List table. Select Next. 3. Allow the wizard to decide how to split the table. 4. Rename Table1 to Project and Table2 to Client. 5. Drag the State field from the Project field list below the City field in the Client field list. 6. Set the Client ID field as the primary key in the Client table. 7. Do not have the Table Analyser Wizard create a query. 8. Select Finish. 9. Close the Microsoft Access Help window. View the tables and then close them and restore the Navigation Pane. 10. Analyse the performance of the Client and Payment tables. (Notice that the analysis result does not fit the data; changing the Zip field to a long integer field would not allow for zip codes with leading zeroes, such as ) 11. Close the Performance Analyser. 12. Close the database file. WWP Learning and Development Ltd Page 7

12

13 TRANSFERING DATA INTRODUCTION You can import data from one or more external data sources. The external data source can be another Access database, a database created in a different program such as Excel, ASCII text, or an HTML data table. When you import data from a spreadsheet, another type of database, or ASCII text, a wizard opens to step you through the process. The format of the data in the external data source does not change. You can use Access to add, edit, or delete the data. If the external data source is an Access database, you can Export data also import database objects such as queries, reports, and forms. This option allows you to copy a query from one Convert files database to another and modify it as necessary, rather than creating a new one. In addition, you can easily copy standard reports and forms between databases. 3 In this lesson, you will learn how to: Import data Link data to an Access table Use the Linked Table Manager To import data from an external source, first open the database the data is to be imported into. Click on the External Data tab. In the Import group, click on the appropriate button. In the Get External Data box, locate and select the file containing the data to import. Select from the options how the data is to be imported. Click on the OK button. Follow the Wizard instructions, selecting the appropriate options and then clicking on the Next button each time. In the Import to table: box, enter a name for the table. If necessary place a check for Access to analyze the data. Click on the Finish button. Choose whether to save the import steps. WWP Learning and Development Ltd Page 9

14 LINKING DATA TO AN ACCESS TABLE You can link to an external data source, such as another Access database or a database created in a different program such as Excel. You can also link to HTML data tables on a network server or on the Internet. Linking tables is useful when you want to share data on a network. If you link to a table on a network, the link ensures that the data you are viewing is always the latest available. When you link to an external data source, the format of the data in the data source does not change, although you can use Access to add, edit, or delete the data. A linked table displays a special icon in the Database window. A table linked to another Access database has an arrow to the left of the icon. A table linked to a source created in a different program displays an arrow and the initials of the source program. When you delete a linked table, you are deleting the icon and the link to the source table, not the source table itself. To link to an Access table, first open the destination database. Click on the External Data tab. In the Import group, click on the Access button. In the Get External Data box, locate and select the database to be linked to the current database. Click on the Link to the data source by creating a linked table option. Click on the OK button. In the Link tables dialog box, click on the table(s) you wish to link. Click on the OK button. The table displays the link in the Navigation pane. Page 10 WWP Learning and Development Ltd

15 USING THE LINKED TABLE MANAGER You can use the Linked Table Manager to view, refresh, or correct the file name and/or path of a linked table. If the structure of a linked table changes, for example, you can use the Linked Table Manager to refresh the link. In addition, if a linked table is moved to a different location, you can use the Linked Table Manager to correct the path and re-establish the link. The Linked Table Manager does not physically move database files or tables; it only refreshes or corrects the link information. If you change the name of a table after it has been linked, the Linked Table Manager will not be able to refresh the links. In this case, you must delete the link and create a new one. To use the Linked Table Manager to correct the path of a linked table, first click on the Database Tools tab. In the Database Tools group, click on the Linked Table Manager button. In the Linked Table Manager dialog box, click on the link(s) you want to refresh. Click on the OK button. OR To change the path to a linked table, click on the Always Prompt for New Location option. Check the tables whose links are to be changed. Click on the OK button. EXPORTING DATA You can export data and database objects to a variety of supported databases, programs, and file formats. For example, you can export data to another program (such as dbase or Excel), to ASCII text, or to an HTML data table. You can also export most database objects from a Microsoft Access database to another Access database. The process of exporting data and database objects is very similar in functionality to copying and pasting. When exporting database objects to another database, you can only export one object at a time. If you need to export multiple objects to a database, it may be more efficient to open the database to which you want to export and import the objects. When you export an object to another database, it might be helpful to export all related objects to ensure full functionality. For example, a report is usually based on a query, and a query is based on one or more tables. WWP Learning and Development Ltd Page 11

16 The following table lists some of the data formats to which you can export: Application Supported Version or Format Microsoft Access database Access 2.0, 7.0/95, 8.0/97, 9.0/2000, 10.0/2002 and 11.0/2007 dbase Paradox, Paradox for Windows Microsoft Excel Microsoft Word, Rich Text Format Lotus Delimited text files XML document III, IV, 5, and 7 (Requires Borland Database Engine 4.x or later) 3.x, 4.x, 5.0, and 8.0 (Requires Borland Database Engine 4.x or later) 3.0, 4.0, 5.0, 7.0/95, 8.0/97, 9.0/2000, and 10.0/Excel 2002 All.wj2,.wk1, and.wk3 All All Page 12 WWP Learning and Development Ltd

17 To export an object to another program, first display the Tables list in the Navigation pane. Click on the table you want to export. Click on the External Data tab. In the Export group, click on the More button. Click on the item for the type of file you export to. Alternatively, use the right mouse button to click on the object you want to export. Select the Export item and the type of file you want to export to. Locate, and select, the file you wish to export to. In the Export dialog box, enter a name for the object and other options accordingly. Click on the OK button. Choose whether to save the export steps. Click on the Close button. WWP Learning and Development Ltd Page 13

18 CONVERTING FILES When you open a database from Access versions that are prior to Access 2000 (eg. Access 97, Access 7.0 (95), Access V2/V1), Access 2007 holds the file in compatibility mode where it disables features which cannot be displayed or converted well by previous versions. The database stays in the original file format until you convert it to the Access 2007 format. You can convert an Access database of earlier format, though you may want to keep the database in the earlier version and just run it in This is important where the database is used by more than one user, all of whom do not have Access You can also convert an Access 2007 format back to an earlier format providing the Access 2007.accdb database does not contain any of the new features. For Access 97 format, the Database Enhancement dialog box will be displayed, indicating the file must be upgraded to be able to use the latest features. To convert an existing database, open the Access 2000 or database you intend to convert to Access 2007 format. Click on the Office button In the Office menu, click on the Convert item. Locate, and select, the location for the converted database. Click on the Save button. In the Message box, click on the OK button to acknowledge the conversion. Page 14 WWP Learning and Development Ltd

19 EXERCISE TRANSFERRING DATA 1. Open Train09X. 2. Import the Sales by Rep 2 query from the Train17x Access database in the student folder. 3. Import with a link, the Sales table from the Train17x database. 4. Open the Linked Table Manager and update the link to the Types table. Correct its path to Train17x in the student data folder. Then, select OK as necessary and close the Linked Table Manager. 5. Open TrainV97. Convert TrainV97 to Access 2007 saving it as TrainV Click OK to the error warning; this is not critical to a successful conversion. 7. Export the Invoice Details query to Excel with formatting and layout and specify that you want to open the Excel file after export is complete. Leave the file name as suggested (Invoice Details) but store it in the student data folder. 8. Close Excel. 9. Do not save the export steps and close the export window. 10. Close the database file. WWP Learning and Development Ltd Page 15

20

21 DATABASE TOOLS INTRODUCTION The main purpose of database security is to prevent unauthorised access to, or changes to, the information contained within the database. Security can also prevent design modifications where the slightest change may cause problems which can be difficult to locate and correct. When you add database protection, you will be asked to supply a password. 4 In this lesson, you will learn how to: Password protect a Database Compact and repair a Database Use Name AutoCorrect Back up a database ADDING SECURITY ENCRYPTION TO A DATABASE (PASSWORD PROTECTING) File encryption is security you can apply to a database which scrambles your password to protect yur file from unauthorised people from opening the file. The password protection takes effect the next time you open that database file. Before you can encrypt a database file in Access, you need to open the database in Exclusive mode in order that the database can be encrypted without any outside connection. This can be done when you open the file or by using the Advanced pane of Access Options. Renaming a database when you encrypt or decrypt it keeps the original database intact. To apply file encryption, first open the database you intend to encrypt in Exclusive mode. Click on the Database Tools tab. In the Database Tools group, click on the Encrypt with Password button. In the Set Database Password box enter, and confirm, the password. Click on the OK button. When the file has been closed, it will only open if the correct password is entered. WWP Learning and Development Ltd Page 17

22 To change or remove password encryption, open the encrypted file. Click on the Database Tools tab. In the Database Tools group, click on the Decrypt Database button. In the Unset Database Password box, enter the password. Click on the OK button. COMPACTING AND REPAIRING A DATABASE When you delete tables and other objects in a database, the database size on the disk does not necessarily decrease. Access provides a utility that compacts (defragments) the database, thereby releasing storage space. You can compact an open database by clicking on the Office button, moving the cursor to the Manage item and choosing Compact and repair Database. To compact and repair a closed database, first close all databases. Click on the Office button. In the Office menu move the mouse cursor to the Manage item. Click on Compact and Repair Database. In the Database to Compact From dialog box, locate and select the database you want to compact. Click on the Compact button. In the Compact Database Into dialog box, locate and select the location for the compacted database. Enter a name for the copy. Click on Save. If you used the same name for the file, confirm the message box. Page 18 WWP Learning and Development Ltd

23 USING NAME AUTOCORRECT The Name AutoCorrect feature automatically fixes inconsistencies that can occur when you rename tables, forms, reports, queries, fields, or other controls in an Access database. The group offers three options which help fix common side effects that occur when you make changes in an object via a user interface. Access stores the identifier for each object and tracks any naming information. When access notices an object has been changed since3 the last Name AutoCorrect action, it runs it again for all items in that object. To use Name AutoCorrect, first click on the Office button. Click on the Access Options button. In the Access Options, click on the Current Database button in the left hand pane. In the Name AutoCorrect Options section, select the options you require. Click on the OK button. BACKING UP A DATABASE It is important to backup your database on a regular basis. Most companies have a backup process to ensure that all data is saved at least once a day; consequently, all databases shared on a company network server are backed up daily as well. Your database may be saved to the hard drive of a personal computer, however, most databases are too large to fit on a floppy disk. In this case, you should back up your hard drive regularly by saving it to another drive or to removable media. Backing up your hard drive ensures that all data, queries, forms, and reports in your database are saved. As a result, you can recover your database if something were to happen to it. WWP Learning and Development Ltd Page 19

24 To back up a database, first open the database you wish to back up. Click on the Office button. Move the mouse cursor to Manage. Click on the Backup Database item. In the Save As dialog box, specify a name and location for the back up copy. Click on the OK button. Page 20 WWP Learning and Development Ltd

25 EXERCISE DATABASE TOOLS 1. Open Train33x exclusively. 2. Encrypt the database using the password secure. Close the database. 3. Open Train33x normally (not exclusively). Notice that you must enter the password. 4. Close Train33x and then re-open it exclusively. 5. Remove the password protection. Close the database. 6. Re-open Train33x normally (not exclusively). Notice that you no longer need to enter the password. 7. Open Train09x. 8. Ensure that the Name AutoCorrect option is enabled 9. Change the name of the LAST_NAME field in the Reps table to LastN and the name of the FIRST_NAME field to FIRSTN. 10. Close the Reps table, saving the changes. 11. Open the Reps form in Design view. Notice that, although the label in the Form Header area has not changed, the control source in the Detail area has been corrected to LastN. Close the Reps form. 12. Compact Train09x, make a backup of it named, Train09x and then close it. WWP Learning and Development Ltd Page 21

26

27 DESIGNING ADVANCED QUERIES INTRODUCTION In Access, queries enable you to retrieve specific data from one or more tables, even when the tables are not open. For this to happen it is obviously necessary to create some form of relationship between the tables if the database has been normalised. It is also useful to be able to make the use of the query as simple as possible for users. Once a database has been normalised it will contain many smaller tables of related information. To combine information from these separate tables relationships can be set up so that when the tables are combined in a query to compile information from more than one table the common fields are automatically joined and the appropriate information is retrieved. If this is the case and the appropriate relationships have not been set up then a join between two tables can be created from within the query. 5 In this lesson, you will learn how to: Join Tables in Queries Work with Cross Products Create Reverse Outer Joins Use the Crosstab Query Wizard Use the Find Duplicates Query Wizard Use the Find Unmatched Query Wizard There are also Query Wizards which allow you to create crosstab queries (spreadsheet lookalikes), queries which can find duplicate records, and queries which will find unmatched records in related tables. JOINING TABLES IN QUERIES When tables are joined a query the join is only effectual within the query it was created and does not affect the rest of the database. Once created the type of join can be changed. The default join type is called an inner or equi join. This type of join will only include records in the recordset where the common fields match. This can be changed to an outer join where the all the records in one of the tables plus all the matching fields from the other table are included in the recordset. This type of outer join can be changed to include all the records from either the left hand or fight hand of the two tables plus the remaining matching fields. Once created the join type can be changed by double clicking on the join in the design view of the query and selecting the appropriate type required from the resulting dialog box. Outer joins are indicated in the query design view by placing an arrow on either the left or right hand side of the join line. Access 2007 will automatically create joins between two fields on different tables when they are added to a query, if they share the same name, one is a primary key and they have the same (or compatible) data types. When adding more than one table to a query the [Control] and [Shift] Keys can be used to make multiple selections of tables in the show table window. Joins may be removed from a query by selecting the join with the mouse and then pressing the [Delete] key. WWP Learning and Development Ltd Page 23

28 To create a join within a query, first create a query within the database you wish to work in. Move the mouse cursor over the first common field. Hold down the mouse button and drag to the second common field in the next table. The join is created between the tables. When a join is set up, the default arrangement is known as an inner join, as shown in the Join Properties dialog box which can be opened by double-clicking on the join line between two tables. If the join is changed to a 2 or a 3 type join the join is then known as left or right outer join. Running a query with an inner join will most likely produce different results from running a query with an outer join, depending on the data involved. CROSS PRODUCTS When a query of more than one table is created without any relationships or joins Access has no way of matching common fields between these tables. When this happens the recordset is said to be called a cross product. A cross product recordset will match every single record on one table with every single record on the second table. For example if you create a query with two tables and no join. If there were 100 records on one table and 40 records on the other the cross product record set would contain 4,000 records (100 * 40). To correct a cross product query you must create an appropriate join between the two tables in the query. CREATING REVERSE OUTER JOINS By using the is null criteria in combination with an outer join it is possible to get a record set from a query that was previously not available. Where sales are involved it would be possible to find which customers have not placed orders. Page 24 WWP Learning and Development Ltd

29 To create a reverse outer join, first open the query you want to work on in Design view. Double-click on the join line. In the Join Properties dialog box, select option 2 (an outer join). Click on the OK button. In the criteria row under the field you wish to examine, type is null. Run the query to find which of the data does not have an entry for that field. An alternative to creating a reverse outer join query manually is to use the Find Unmatched Query Wizard (see page 28). USING THE CROSSTAB QUERY WIZARD Crosstab queries are used to group and summarize information in a spreadsheet format. Crosstab queries make it easier to read and analyse selected data. You must have three fields in a crosstab query. The values in the first field appear as row headings in the resultant spreadsheet, the values in the second field appear as column headings, and the calculation is performed on the values in the third field. A crosstab query can display, for example, products sold (row headings) by sales representative (column headings); the number of products sold by each sales representative would appear at the intersection of the corresponding row and column. Crosstab queries can also involve other functions such as sum, count, and average. You cannot update crosstab queries and the value in a crosstab query cannot be change in order to change the source data. WWP Learning and Development Ltd Page 25

30 To create a crosstab query, first click on the Create tab. In the Other group, click on the Query Wizard button. In the New Query box, click on the Crosstab Query Wizard option. Click on the OK button. From the list, select the table/query which contains the records you want to retrieve. Click on the Next button. From the Available Fields: list, add the field you want to use as row headings to the Selected Fields: list. Click on the Next button. Click on the field you want for column headings. Click on the Next button. In the Fields: list, click on the field you want to calculate. In the Functions: list, click on the required function. Click on the Next button. Enter a name for the query and click on the Finish button. USING THE FIND DUPLICATES QUERY WIZARD You can use a Find Duplicates Query Wizard to find duplicate records in a table. For instance, there may be identical records stored in a table, when only one record is necessary. The Find Duplicates Query Wizard will locate and display records in which the specified field has the same values. Page 26 WWP Learning and Development Ltd

31 To create a find duplicates query, first click on the Create tab. In the Other group, click on the Query Wizard button. In the New Query dialog box, click on the Find Duplicates Query Wizard item. Click on the OK button. Select the table or query you want to use for the query. Click on the Next button. Add the desired fields to the Duplicate-value fields: list. Click on the Next button. Add any other required fields to the Additional query fields: list. Click on the Next button. Enter a name for the query. Click on the Finish button. Running the query displays any duplicate entry fields. WWP Learning and Development Ltd Page 27

32 USING THE UNMATCHED QUERY WIZARD The Find Unmatched Query Wizard allows you to locate and display records in one table which have no match in a related table. You can use the Find Unmatched Query Wizard to correct the problem by updating the Customers table. However, unmatched records cannot occur if referential integrity is enforced in the table relationship. To create a Find Unmatched query, first click on the Create tab. In the Other group, click on the Query Wizard button. In the New Query dialog box, click on the Find Unmatched Query Wizard item. Click on the OK button. In the first dialog box, select the table/query whose records you want to display. Click on the Next button. Select the table which contains the related records. Click on the Next button. If necessary, specify the joining field. Choose the field from each list. Click on the button to join them. Click on the Next button. Choose which fields from the Available fields: list to display in the query. Click on the Next button. Enter a name for the query. Click on the Finish button. Page 28 WWP Learning and Development Ltd

33 EXERCISE - DESIGNING ADVANCED QUERIES 1. Open Train12X. 2. Create a query in design view. 3. Add the Trainer and Project tables. 4. Add the Initials, Project ID and Start Date Fields. 5. Run the query and observe the cross product result. 6. Return to the design view. 7. Create a join between the Initials field in the Trainer field list and the Trainer Initials field in the Project field list. 8. Run the query and observe the results. 9. Return to the design view. 10. Change the join type to include all the records from the Trainer table. 11. Run the query and observe the results. Which trainers have not run any projects? 12. Close the query saving it as Join. 13. Open Train17x. 14. Create a crosstab query from the existing Sales by Rep query. Use the Client ID field for the row headings and the Sales Rep field for the column headings. Have the calculated value be the sum of the Total Sales field. Remove any other fields from the grid. 15. Name the query Total Sales by Sales Rep, and select the option to view the query. After you have viewed the recordset, close the query. 16. Use the Find Duplicates Query Wizard to locate any duplicate records in the Client table. Select the Client Name, Address, and City fields as possible duplicate-value fields. Do not select any additional fields to show in the query results. 17. Name the query Find Duplicate Clients and select the option to view the query. Notice that two duplicate records were found. Close the query. 18. Use the Find Unmatched Query Wizard to find any projects in the Project table that have no record of payment in the Payment table. Select the Project ID field as the matching field for the two tables, if necessary. Then, have the Client ID, Course Name, and End Date fields also display in the query. 19. Name the query No Record of Payment and select the option to view the results. After you have viewed the recordset, close the query. 20. Close the database file. WWP Learning and Development Ltd Page 29

34

35 CREATING RELATIONSHIPS INTRODUCTION Tables can be joined, or related, in order to access and coordinate information in all the fields of the related tables. Joining tables is a useful way to avoid entering duplicate information in various, related tables. In addition, it allows you to create reports, forms, and queries from the related data tables and save them in the database file. Relating tables allows you to create smaller, more efficient tables that can be referenced when you need access to the data. When you relate tables, the table from which you select a field to join is the primary table, and the second table View subdatasheets containing the field you want to associate is the related Delete a join line query table. The tables must have at least one common field that contains the same type of data. This common field Printing Relationships is called the join field. The join fields in both tables must have the same or equivalent data types and, if they are Number fields, they must have the same field size. In addition, the join field in the primary table must be the primary key in order to avoid duplicate entries. For example, the following table consists of customer names and address fields, along with a unique identification number for each customer, which serves as the primary key in the table. You can create this number or allow Access to create it for you. ID # Names Address City State Zip 1 Smith J St. NW Washington DC Conrad 16 Allegheny Center Pittsburgh PA Kane 1012 Broadway Lexington KY Apple 516 Beacon Ave. Seattle WA Billow 9249 Cavalcade St. Houston TX In this lesson, you will learn how to: Use related tables Create a relationship between tables Set referential integrity You could then create a separate table consisting only of orders placed by customers. This table would also contain the field for the unique customer identification number, but not the customers names and addresses. WWP Learning and Development Ltd Page 31

36 ID # Order 1 Office Work Center 2 All-In-One Corner Desk and Hutch 3 Open-Front Steel Bookcase 4 2-Drawer Letter File 5 Executive Leather Chair, Black By relating the two tables through the common customer identification number field, the customers name and address does not have to be entered for every order. All that has to be entered is the customer identification number, along with the orders. Access includes two basic types of relationships: one-to-many and one-to-one. A one-to-many relationship occurs when one record from the primary table matches many records from the related table (e.g., one customer record matches many order records). A one-to-one relationship occurs when one record from the primary table matches one record from the related table. Access determines the relationship type automatically when you create the relationship. CREATING A RELATIONSHIP BETWEEN TABLES The Relationships window displays a graphic representation of database relationships and allows you to create relationships between tables. You drag field lists in the Relationships window to reposition them as needed. In addition, any field name that represents a primary key is bolded in the corresponding field list. You can add tables to the Relationships window for additional joins. For example, if the Relationships window displays only two related tables and you need to access information from a third table, you can easily add the required table to the Relationships window and then create the join. You can select multiple tables in the Show Table dialog box by holding the [Ctrl] key as you click each table. Selecting Add adds all the selected tables to the Relationships window. The Show Table dialog box opens automatically if no tables have been added to the Relationships window. Page 32 WWP Learning and Development Ltd

37 To create a relationship between two tables, first click on the Database Tools tab. Click on the Relationships button in the Show/Hide group. If necessary, click on the Show Table button. Click on the Tables tab. Click on the first table you want to relate to. Click on the Add button. Select the second table you want to relate. Click on the Add button. Add further tables as required. Click on the Close button. Drag the common field in the first table to the common field in the second table. In the Edit Relationships dialog box, click on the Create button. Repeat for any further relationships. Click on the Close button. Close the Relationships window. In the Message box, click on the Yes button. SETTING REFERENTIAL INTEGRITY When you create a relationship between two tables, you can set referential integrity. Referential integrity is a built-in set of rules Access uses to make sure that the relationship is valid. Referential integrity can also prevent accidental deletion or editing of data. In order to use referential integrity, the following conditions must be true: the related field in one table must be its primary key, the related fields in both tables must have the same data type, and both tables must belong to the same database. When you set referential integrity, you must observe the following three rules: First, you cannot enter data in the join field in the "many" table that does not have a match in the join field in the "one" table. Second, you cannot delete records from the "one" table if there are matching records in the "many" table. Third, you cannot edit primary key values if related records exist. If you want to perform any of the changes listed above, however, and still maintain referential integrity, you can select the Cascade Update Related Fields and Cascade Delete Related Records options in the Edit Relationships dialog box. If either or both of these options are selected, Access automatically makes the necessary changes to related tables to maintain referential integrity. It is recommended that these two options be selected only after careful consideration, since the changes cannot be undone. WWP Learning and Development Ltd Page 33

38 When referential integrity is enforced, Access displays symbols above the join line to indicate the type of relationship, one-to-one or one-to-many. The number 1 above a join line indicates one, and the mathematical symbol for infinity (which resembles a horizontal 8) indicates many. Double-clicking the middle segment of any join line opens the Edit Relationships window with the selected join displayed. Double-clicking the beginning or ending segment of any join line opens the Edit Relationships window, but with no join selected. You can then use the Table/Query list to select the desired join. To set referential integrity for the relationship between tables, first click on the Design tab below the Relationship Tools tab. Open the Relationships window by clicking on the Relationships button. Click on the Edit Relationships button in the Tools group (or double-click on the join line between the two tables whose referential integrity you want to establish). In the Edit Relationships dialog box, select the Enforce Referential Integrity option. Click on the OK button. VIEWING SUBDATASHEETS Subdatasheets are datasheets nested in the primary table and display the data in joined tables. When you join tables in a one-to-many relationship, Access creates subdatasheets in the table containing the primary key. Access can also create subdatasheets for one-to-one relationships. When tables are joined, Access inserts a column containing plus signs to the left of the first field in the primary table. Clicking the plus sign expands a subdatasheet with the data in the related table displayed. If the table contains additional joins, you can expand subdatasheets to display each related table. Access can display up to eight levels of subdatasheets. In addition to viewing data, you can edit data right in the subdatasheet; the edited data is saved back to the table in which it is stored. Page 34 WWP Learning and Development Ltd

39 To display subdatasheets, first open the table in Datasheet view. Click on the plus sign [+] next to the record you want to expand. Display additional subdatasheets, if available. Click on any minus sign [-] to collapse the subdatasheet. Close the table. DELETING A JOIN LINE Deleting a join line removes the relationship between two tables. You may want to delete a join line if you no longer need to relate the tables or you want to create a different relationship. You must select a join line before you can delete it. You must click the middle segment of a join line in order to select it; clicking the beginning or ending segment does not select the join line. You can also delete a join line by right-clicking its middle segment and selecting the Delete command. To delete a relationship, first open the Relationships window. Click on the middle of the join line you wish to delete. Press the [Delete] key. Confirm the Message box by clicking on the Yes button. Alternatively, use the right mouse button to click on the join line. Select Delete and confirm the Message box. PRINTING RELATIONSHIPS WWP Learning and Development Ltd Page 35

40 Once all the relationships have been defined for a database, it is often helpful to have a printed copy of the relationships. To print the relationships diagram, first open the database you wish to document. Click on the Database Tools tab. In the Show/Hide group, click on the Relationships button. In the Relationships window, use the right mouse button to click in a blank area of the window. In the shortcut menu, select Show All. In the Tools group of the Design Ribbon, click on the Relationship Report button. The relationships are displayed as a report and can be saved as such. Page 36 WWP Learning and Development Ltd

41 EXERCISE - CREATING RELATIONSHIPS 1. Open Train08x. 2. Open the Relationships window. 3. Add the Client and Project tables to the Relationships window. 4. Create a relationship between the Client ID field in the Client table and the Client ID field in the Project table; set referential integrity for the relationship. 5. Add the Trainer table to the Relationships window. 6. Create a relationship between the Trainer Initials field in the Project table and the Initials field in the Trainer table; set referential integrity for the relationship. 7. Close the Relationships window and save the changes. 8. Open the Client table in Datasheet view and view the subdatasheet for the CONCORD client. Then, collapse the subdatasheet and close the Client table. 9. Print a relationship document. Then close Print Preview, close the Report design window without saving changes. 10. In the Relationships window, delete the relationship line between the Project and Trainer tables and remove the Trainer field list, since it is no longer related to any tables. Then, close the Relationships window and save the changes. 11. Close the database file. WWP Learning and Development Ltd Page 37

42 FORM DESIGN TOOLS AND METHODS INTRODUCTION You can create or customize a form in Design view. A form has three basic sections: Detail, Form Header/Footer, and Page Header/Footer. The Detail section contains the information from the table or query. You create controls in the Detail section that allow you to display or enter information. Access provides a variety of control types you can add to the form to simplify the data entry process. For example, you can replace a text box with a list box or an option group so that you can select a value rather than type it during data entry. In many cases, it is quicker and easier to select a value from a list rather than to remember the value you want to use and then type it. Having a list of choices also helps to ensure the consistency of the data being entered. The Form Header and Form Footer sections display at the top and bottom of a form in Form view. They are stationary when you scroll the Detail section, making them useful for displaying titles or instructions you want visible on the form at all times. If you print the form, 7 In this lesson, you will learn how to: Use forms in Design view Set the tab order automatically Set the tab order manually Add a form header and footer Create a blank form Save a form as a report Create a PivotTable or PivotChart view these sections appear at the top of the first page and at the bottom of the last page. You can also place controls, including images, labels, and fields in the form header or footer. The Page Header and Page Footer sections display at the top and bottom of the form in Design view. They do not appear in Form view. Rather, they display at the top and bottom of every page when the form is printed. Page headers and footers can contain images, lines, and text, or any other controls you want printed on every page. When you enable the display of either the page or form header/footer section, both the header and the footer appear. You can drag the header and footer sections to resize them. Page 38 WWP Learning and Development Ltd

43 In Access it is also possible to save a form such that it can be printed as a report, which is of value when customers have to fill in a form which must then be printed out. When it is necessary to summarise information from a lengthy list, you can use the PivotTable to simplify the task, rather than having to manually calculate which records meet certain criteria. Such information can be viewed in a PivotChart. SETTING THE TAB ORDER AUTOMATICALLY The tab order determines the order in which form fields and controls are selected when you press the [Tab] key during data entry. The default tab order is the order in which the fields or controls were added to the form. If you have added, rearranged, or deleted fields or controls, the tab order may not be suitable for data entry. You can choose to have Access automatically rearrange the tab order to reflect the order of the fields on the form. The fields are then accessed from left to right across each row. To set the Tab order automatically, first open the form you want to set the Tab on in Design view. Click on the Arrange tab under the form Design Tools tab. In the Control Layout group, click on the Tab Order button. In the Tab Order dialog box, click on the Auto Order button. SETTING THE TAB ORDER MANUALLY The tab order determines the order in which form fields and controls are selected when you press the [Tab] key during data entry. The default tab order is the order in which the fields or controls were added to the form. If you have added, rearranged, or deleted fields or controls, the tab order may not be suitable for data entry. You can adjust the tab order manually to reflect whatever order is best for your data entry needs. WWP Learning and Development Ltd Page 39

44 To set the Tab order manually, first open the form whose tab order is to be changed in Design view. Click on the Tab Order button in the Control Layout group. In the Tab Order dialog box, click on the record selector to the left of the field you want to move. Drag the on the field selector to the new position. Click on the OK button. The tab order will now be changed when the form is opened in Form view. ADDING A FORM HEADER AND FOOTER The Form Header and Form Footer sections display at the top and bottom of the form in Form view. They are stationary when you scroll the Detail section, making them useful for displaying titles or instructions you want visible on the form at all times. You can change the height of a section by dragging the bottom border of the section up or down. You can display the Form Header and Form Footer sections by rightclicking in the form in the Design window and then selecting the Form Header/Footer command. If you print the form, these sections appear at the top of the first page and the bottom of the last page respectively. You can place controls, including images, labels, and fields, in the form header or footer. To add a form header and/or footer, first open the form in Design view. Click on the Arrange tab below the Form Design Tools tab. In the Show/Hide group, click on the Form Header/Footer button. The form displays both Header and Footer panes. Page 40 WWP Learning and Development Ltd

45 CREATING A FORM WITHOUT USING THE WIZARD You can create a form from scratch in Design view. For example, if a form does not currently exist for a particular table or query, you can create one using the fields in the selected table or query. You can then determine the design of the form by adding fields, control, and options. To create a blank form, first click on the Create tab. In the forms group, click on the Blank Form button. The form is displayed in Layout view together with the Field List. To display rulers and grid, switch to Design view. If necessary, click on the Show all tables button. Select the table on which you want to base the form. Drag fields from the Field List onto the blank form where you want to place them to create the form. Click on the Save button on the Quick Access Toolbar. Enter a name. Click on the OK button. CREATING A PIVOTTABLE OR PIVOTCHART VIEW You can view any database form in PivotTable or PivotChart view using the View list. In PivotTable view, you can summarize and analyse large amounts of data. PivotChart view allows you to display data in a graphical environment. You design a PivotTable or PivotChart view by WWP Learning and Development Ltd Page 41

46 dragging fields from the Field List to preset drop areas in the PivotTable or PivotChart view workspace. As an alternative to dragging fields, you can also select the desired field in the Field List, select the desired drop area from the bottom of the Field List, and then use the Add to button to add the field to that field. In the Field List, fields are listed below a corresponding fieldset. When you expand the fieldset, the individual fields are displayed. Field names become bold when they are added to the view workspace. Once the table or chart is designed, fields can be moved, added, or deleted as desired. In addition, you can apply formatting to the items in PivotTable or PivotChart to enhance its appearance. You can use options in the property sheet to apply formatting. PivotTable and PivotChart views are automatically saved and updated as part of the layout of the form when you close the form. You can also display data in a table or query in PivotTable and PivotChart view. To create a PivotChart Form, first select the table you intend to use. Click on the Create tab. In the Forms group, click on the More Forms button. From the list, select PivotTable. If necessary, click on the Design tab and click on the Field List button to display the Field List. In the blank PivotTable, drag the required field item to the Drop Row Fields here box. Drag the required field items to the appropriate Filter, Column, and Total or Detail boxes. Click on the Save button on the Quick Access Toolbar. In the Save As dialog box, enter a name, and click on the OK button. Page 42 WWP Learning and Development Ltd

47 To filter the data in the PivotTable, click on the list arrow in the Filter box and select the item(s) to display then click on the OK button to display data pertinent only to those items. Click on the list arrow in the Row box and select the item(s) to display then click on the OK button to display data pertinent only to those items. Click on the list arrow in the Column box and select the item(s) to display then click on the OK button to display data pertinent only to those items. To create a PivotChart, first select the table you intend to use. Click on the Create tab. In the Forms group, click on the PivotChart button. If necessary, click on the Design tab and click on the Field List button to display the Field List. In the blank PivotChart, drag the required field item to the Drop Series Fields Here box. Drag the required field items to the appropriate Filter, Data, and Category boxes. Click on the Save button on the Quick Access Toolbar. In the Save As dialog box, enter a name, and click on the OK button. WWP Learning and Development Ltd Page 43

48 To filter the data in the PivotChart, click on the list arrow in the Filter box and select the item(s) to display then click on the OK button to display data pertinent only to those items. Click on the list arrow in the Series box and select the item(s) to display then click on the OK button to display data pertinent only to those items. Page 44 WWP Learning and Development Ltd

49 EXERCISE FORM DESIGN TOOLS AND METHODS 1. Open Train18x. 2. Open the New Payment Form in Design view. Display the ruler, if necessary. 3. Open the Tab Order dialog box and set the tab order automatically. 4. Switch to Form view and press [Tab] as necessary to view the tab order. Return to Design view. 5. Create a custom tab order. Move the Payment Date above the Amount Paid and close the Tab Order dialog box. 6. Display the form header in Design view and create a label with the text Payment Form in the left side of the form header. 7. Close the form and save it. 8 Open Train29x. 9. Select the Payment table in the Navigation Pane. Create a PivotTable using Project ID in the rows, Months in the columns (Hint: Open the Payment Date By Month group in the field list and select Months), Amount Paid in the detail field, and Credit Rating in the filter field. 10. Close the form without saving any changes. Close the database file. WWP Learning and Development Ltd Page 45

50

51 AUTOMATING FORMS WITH CONTROL WIZARDS 8 INTRODUCTION By using the Control Wizards, automated controls can be more easily created on a form. For example, a set of option buttons can be set up on a form to enable the user to make a choice rather than having to type in the information, a list box could be added to a form to assist in selecting the correct data or a command button could be set up to enable easier use of the form or that when clicked, will display a separate form showing additional information about the currently displayed record. If you select the Control Wizards button before you create a command button, Access provides you with easy steps to create the control. In this lesson, you will learn how to: Activate the Control Wizards Create a Command Button Use Navigation Control Wizards Create a combo box Create a list box Create an option group Add a logic control Work with an ActiveX Control ACTIVATING THE CONTROL WIZARDS Although normally activated by default, the Control Wizards may have been deactivated for the purpose of creating automated controls manually, or by accident. To ensure that Access assists you to create special controls, the Control Wizards must be activated. To activate the Controls Wizards in order to help you create automated controls on a form, first open the database containing the form you require. Open the required form in Design view. Click the Design tab on the Ribbon. Click the Form Wizards button in the Controls group. WWP Learning and Development Ltd Page 47

52 CREATING COMMAND BUTTONS TO CARRY OUT FORM ACTIONS By using the Control Wizards, a command button can be set to open a form when clicked. The form can be opened for viewing or printing. You can also specify whether you would like to open the form to view all records, or open it to view just specific data. An action can thus be carried out on a form, without having to return to the navigation pane. To add a button to carry out an action on a form, first open the database containing the form you require. Open the required form in Design view. Ensure the Control Wizards button in the Controls group is active. In the Controls group, Click on the Button button. Click in the form where you want to insert the command button. In the Command Button Wizard click on the required category in the Categories: list box. In the Actions: list, select the action you want. Click on the Next button. In the next step of the Wizard, select the form you want to open. Click on the Next button. Select the option you require for the data display. Click on the Next button. Enter text for the button or specify a picture. Click on the Next button. Provide a name for the button. Click on the Finish button. Page 48 WWP Learning and Development Ltd

53 CREATING COMMAND BUTTONS TO CARRY OUT REPORT ACTIONS By using the Control Wizards, a command button can be set to open a Report when clicked. The Report can be opened in Print Preview or printed directly. An action can thus be carried out on a report, without having to return to the navigation pane. To create a button to carryout an action on a report, first open the database containing the form you require. Open the required form in Design view. Ensure the Control Wizards button in the Controls group is active. In the Controls group, click on the Button button. Click in the form where you want to insert the command button. In the Command Button Wizard click on the required category in the Categories: list box. In the Actions: list, select the action you want. Click on the Next button. Select the report you want to work with. Click on the Next button. Enter the text for the button or select a picture. Click on the Next button. Enter a name for the command button. Click on the Finish button. WWP Learning and Development Ltd Page 49

54 CREATING COMMAND BUTTONS TO CARRY OUT RECORD NAVIGATION/OPERATION The Control Wizards can be used to create command buttons that control record navigation within a form. A command button can thus be set up to move forward or backwards through records in a form, or to create a new record. This can be useful when creating forms for users who are not familiar with Access. To add a navigation command button to a form, first open the database containing the form you require. Open the required form in Design view. Ensure the Control Wizards button in the Controls group is active. In the Controls group, click on the Button button. Click in the form where you want to insert the command button. In the Command Button Wizard click on the required category in the Categories: list box. In the Actions: list, select the action you want. Click on the Next button. Enter the text for the button or select a picture. Click on the Next button. Enter a name for the command button. Click on the Finish button. CREATING A COMBO BOX The control wizards can help you create a combo box on a form. A combo box provides you with a list of values from which you can choose. Choosing from a list is much faster and more accurate than remembering a value to be typed. However, you can also type a value directly into a combo box if the appropriate value is not available from the list. A combo box can be bound to a field, meaning that when you select or enter a value, that value is entered into that field in the corresponding table. A combo box can also be unbound, meaning that when you select or enter a value, it is held in memory to be used in another control or calculation. Page 50 WWP Learning and Development Ltd

55 Access provides a Combo Box Wizard that guides you through the process of creating a combo box. When you use the Combo Box tool, the mouse pointer changes into a copy of the tool with a plus sign (+) above and to the left of it. To create a Combo Box, first open the required form in Design view. Click on the Design tab under form Design Tools. In the Controls group, if necessary, click on the Control Wizards button to activate it. Click on the Combo Box button. Click in the Form at the location where you want the combo box to appear. In the Combo Box Wizard, select the required option for source of the values and click on the Next button for each successive page of the Wizard. If applicable, select the table/query containing the values you want for the combo box. Select the field containing the required values. Select the sort list(s) as required. Adjust the column width as required. If applicable select the required field name. Enter a suitable label name. Click on the Finish button. CREATING A LIST BOX The control wizards can help you create a list box on a form. A list box provides you with a list of values from which you can choose. Choosing from a list is much faster and more accurate than remembering a value to be typed. However, unlike a combo box, you can only choose an item from the list; values not present on the list cannot be entered into the table. A list box can be bound to a field, meaning that when you select or enter a value, the value is entered into a field in the corresponding table. A list box can also be unbound, meaning that when you select or enter a value, it is held in memory to be used in another control or calculation. WWP Learning and Development Ltd Page 51

56 The List Box Wizard guides you through the process of creating a list box. You can set the default value for a list box by opening the property sheet and typing the desired value in quotation marks in the Default Value property box on the Data page. To create a List Box, first open the required form in Design view. In the Controls group, click on the List Box button. Click in the form where you want the list box to be displayed. In the List Box Wizard, select the option you require. Work through the pages by clicking on the Next button each time. In the Number of columns: box, type a value for the number of columns you require. Select the required storage option. Type a label for the list box. Click on the Finish button. CREATING AN OPTION GROUP An option group on a form provides you with a limited set of values from which you can choose. Choosing from a set of values is often much faster and more accurate than remembering a value to be typed. With an option group, you can only select one option from the set of alternatives. Therefore, option groups are best utilized when there are five or less values from which to choose. Adding more than five values to an option group can crowd a form and is less effective for quick data entry. An option group has a frame that encloses the set of values. These values appear beside option buttons or check boxes, or on top of toggle buttons. The Option Group Wizard guides you through the process of creating an option group. An option group can be bound to a Page 52 WWP Learning and Development Ltd

57 field in a table or query. However, only the frame is bound to the field. Within the frame, Access assigns each option a numeric value, starting with the number 1. When the option is selected, this numeric value is entered into the corresponding field. Access assigns a number because the value of an option group cannot be text. For example, if a product comes in three colors (white, black, and green), you can use an option group in an order entry form to select the color being ordered. By default, Access assigns the number 1 to the White option, the number 2 to the Black option, and the number 3 to the Green option. You only see the White, Black, and Green options on the form, but Access actually stores the assigned numbers in the corresponding field in the table. When you use the Option Group tool, the mouse pointer changes into a copy of the tool with a plus sign (+) above and to the left of it. The center of the plus sign (+) indicates the position of the top left corner of the option group. WWP Learning and Development Ltd Page 53

58 To create an option group on a form, first open the form in Design view. Ensure the Control Wizards button is activated. In the Controls group, click on the Option Group button. Click in the form where you want the option group to be displayed. In the Option Group Wizard, on each row, type the label names you require. Click on the Next button. In the next box, choose from the options for a default value. Click on the Next button. Accept, or enter, values for each row. Click on the Next button. Select from the two options and assign a field if necessary. Click on the Next button. In the next box, select the type of controls and style you require. Click on the Next button. In the final box, enter a label name for the option group. Click on the Finish button. ADDING A LOGIC CONTROL Some tables contain fields that have a Yes/No field type. These fields can contain a Yes (True) value, a No (False) value, or no value at all. When working with a form that contains a Yes/No field, you can create a logic control that is bound to the Yes/No field. Logic controls give a visual display of the value in a Yes/No field, such as a check box where a check mark appears when the field value is Yes and does not appear when the value is No. Another type of logic control is the toggle button, which appears sunken for a value of Yes and raised for a value of No. The logic control for a field with a null value (neither Yes nor No is chosen) appears the same as the field with a No value. Page 54 WWP Learning and Development Ltd

59 Logic controls improve the visual effectiveness of a form and facilitate data entry. With a logic control, the value of a Yes/No field is selected with a single click of the mouse button rather than multiple keystrokes. The way in which the different controls indicate a Yes or No value are described in the following table: Control Toggle button Option button Check box Appearance Appears sunken with a Yes value and raised with a No value. Contains a dot with a Yes value and appears empty with a No value. Appears checked with a Yes value and unchecked with a No value. To add a logic control to a form, first open the required form in Design view. In the controls group, click on the logic control tool you want to use. Click in the form where you want the logic control to be displayed. In the Tools group, click on the Property Sheet button. In the Property Sheet, click on the Data tab. In the Control Source box, click on the list arrow. Select the field you want bound to the logic control. Close the Property Sheet. Select the label box of the logic control. Select the text. Type the required name for the control. Press the [Enter] key. ACTIVEX CONTROLS In addition to the standard controls, such as option groups, combo boxes, and list boxes, you can add ActiveX controls to a form or report. ActiveX controls are small applications that can improve the appearance or functionality of a form or report. Other ActiveX controls are available from the Access Developer s Edition as well as from vendors other than Microsoft. ActiveX controls have an.ocx file extension. Make sure you activate macro, ActiveX, add-in, and VBA code detection and notification. You can use the Trust Center to help protect you from attached code attacks. The Trust Center checks for trusted sources, providing security options to ensure the best possible protection. When a potentially harmful attack is detected, the Trust Center displays a security alert in the Message Bar. WWP Learning and Development Ltd Page 55

60 ADDING AN ACTIVEX CONTROL Once an ActiveX control is added, it can be used like any other control. You can move and size it, as necessary, to fit on the form or report. You can also display and change the properties of an ActiveX control. To add an ActiveX control, first open the required form in Design view. Click on the Design tab below the Form Tools tab. In the Controls group, click on the Insert ActiveX Control button. In the Insert ActiveX Control dialog box, select the control you wish to insert. Click on the OK button. The ActiveX control is displayed on the form/report and can be manipulated as required. ATTACHING AN ACTIVEX CONTROL Depending on the ActiveX control and its function, you can attach it to an existing table in Access. For example, you can attach the calendar control to a Date field in Access. The calendar will then display the date on a calendar page for the appropriate month and year. Page 56 WWP Learning and Development Ltd

61 To attach an ActiveX control to a data source, first open the form you want to use. Add the calendar ActiveX control. Select the ActiveX control. Click on the Property Sheet button. In the Property Sheet, click on the Data tab. Click on the Control Source list. Select the desired data source. Close the Property Sheet if necessary. When the form is viewed the calendar date is related to the specified field. WWP Learning and Development Ltd Page 57

62 EXERCISE - AUTOMATED CONTROLS ON FORMS 1. Open Train18x. 2. Open the New Payment Form in Design view. Display the ruler, if necessary. 3. Ensure that the Control Wizards are active. 4. Using the Combo Box tool, create a combo box for the trainers initials at the 3.8cm (1 1/2") mark the horizontal ruler, below the Payment Date text box. 5. Indicate that the combo box should look up values in a table as the source for the values in the list. Select Table: Trainer as the table and include the Initials field in the combo box. Accept the default sort order and column width. Store the values entered in the combo box in the Trainer Initials field and label the combo box Trainer Initials. 6. Using the List Box tool, create a list box for the credit rating at the 3.8cm (1 1/2 ) mark on the horizontal ruler, below the Trainer Initials combo box. 7. Indicate that you want to type in the values for the list box. Use one column and type the values A, B, and C as separate entries. Store the values entered in the list box in the Credit Rating field and label the list box Credit Rating. 8. Reduce the height of the list box so that it displays only one line of text. Move the controls under, and left-aligned with the Trainer Initials controls. 9. Select the Project ID, Payment Date, Trainer Initials, and Credit Rating bound controls (text boxes) and size them to the narrowest size. Then, vertically space them equally. 10. Using the Option Group tool, create an option group at the 2.5cm (1 ) mark on the vertical ruler, below the Total Sale text box. 11. Type Yes and No as the label names and select Yes as the default choice. Change the default value of the Yes label to -1 and the No label to 0. Store the value entered in the option group in the Recorded field. Use Option buttons as controls and select the Raised style. Enter Recorded? as the label. 12. Adjust the position of the controls to line up with those above. 13. Use the Command Button Wizard to add a command button at the bottom left of the form. The button must run the Payment Information query. (Hint: Select the Miscellaneous category in the wizard.) Have the text Payment Info appear on the command button and name the button PaymentInfo. Position the command button on the form, as desired. 14. View the form and click the Payment Info command button to run the query. Close the query and then save and close the New Payment Form. 15. Open Train30x. 16. Open the Project Form in Design view. Page 58 WWP Learning and Development Ltd

63 17. Insert the ActiveX calendar control onto the form. 18. Open the property sheet for the calendar control. Set the data source in the Control Source property box to the Start Date field. Close the property sheet. 19. Size the calendar control until it is approximately 3'' wide and 2'' high and position it below the existing controls, if necessary. Add a label called Start Date and centre it above the calendar control. 20. Switch to Form view and move through the records. Notice that the calendar changes to reflect the start dates. 21. Close the form without saving the changes. 22. Close the database file. WWP Learning and Development Ltd Page 59

64

65 ADVANCED REPORT DESIGN INTRODUCTION The Access Report Wizard provides you with a considerable amount of choices when setting up a report. However, you can also use the same controls that are used in forms to improve the appearance, and amount of, data displayed when the report is printed. You can create or customize a report in Design view. A report has three basic sections: Detail, Report Header/Footer, and Page Header/Footer. The Detail section contains the information from the table or query. You create controls in the Detail section that display information. You can display either one record per page or multiple records per page. The Report Header and Report Footer sections display at the top and bottom of the report in Design view. When you print the report, these sections appear at the beginning and the end of the report only. The header can be used for report titles, while the footer can be used for report totals or other summaries. The Page Header and Page Footer sections display at the top and bottom of the report in Design view. When the report is printed, these sections appear at the top and bottom of every page. Page headers and footers can contain images, lines, text, or any other controls you want printed on every page. When you enable the display of either header and footer section, both the header and the footer appear. You can drag the header and footer sections to size them. 9 In this lesson, you will learn how to: Add report sections in Design view Create a calculated control Group data in a report Create group headers and footers Create a running summary Insert a date/time control Insert a page break Change the report margins Create a report without using a wizard To add Headers and Footers to a report, first open the desired report in Design view. Click on the Arrange tab below the Report Design Tools tab. In the Show/Hide group, click on the Report Header/Footer button. The report now displays header and footer areas. WWP Learning and Development Ltd Page 61

66 To add Headers and Footers to each page of a report, first open the desired report in Design view. Click on the Arrange tab below the Report Design Tools tab. In the Show/Hide group, click on the Page Header/Footer button. The report now displays header and footer areas for each page. CREATING A CALCULATED CONTROL You can add a calculated control to a form or report. A calculated control is not bound to a field. It contains an expression that uses information from fields to calculate a result. The result is not stored in a table. It is calculated when the report or form is run. You can type the expression that calculates the result directly into the control or open the property sheet and type the expression into the Control Source property box on the Data page. You can also create an expression using the Expression Builder. A calculated control in a form or report cannot be based on another calculated control in the form or report. However, you can base a calculated control on a calculated field in a query. Page 62 WWP Learning and Development Ltd

67 To create a calculated control in a report, first open the required report in Design view. Create a text box control positioned where the calculated field is to be displayed. Click on the Design tab under the Report Design Tools tab. In the Tools group, click on the Property Sheet button. Click on the Data tab in the Property Sheet. Click in the Control Source box. (You can press the [F2] key to open the Zoom box to enter the expression.) Type an equal sign (=) and then type the desired calculated control expression. Select the label box to the left of the calculated control. Press the [Delete] key. If required, close the Property Sheet. GROUPING DATA IN A REPORT You can group data in reports that have a common field. It is often easier to read a report when data is grouped, since you can then easily find the pertinent data. A grouped report automatically sorts the table by the data in the grouped field. You can nest groups inside one another, up to ten levels. When you group data, you can display a group header and footer that can be used to display information at the top or bottom of each group. For example, you can add a calculated control in a group footer that calculates summary information, such as a total or an average for each group. Additionally, you can control page breaks by specifying how group heading and records should be kept together. the Group, Sort and Total pane provides all the options you need for your group headers and footers. WWP Learning and Development Ltd Page 63

68 To group or sort data in a report, first open the report you want to format in Design view. Click on the Formatting tab under the Report Layout Tools tab. In the Grouping & Totals group, click on the Group & Sort button. In the Group, Sort and Total pane, click on the Add a group button (or Add a sort button if you are only sorting). Click on the field you want to group or sort by. To create a more complex group or sort, click on the More arrow and select the options you want. When finished setting the group or sort, close the Group, Sort and Total pane. CREATING GROUP HEADERS AND FOOTERS You can create a header and footer for each group that appears in a grouped report. The header displays at the top of each group while the group footer displays at the bottom of each group. A group footer is often used to display summary information about the group, such as total or average sales. Page 64 WWP Learning and Development Ltd

69 To create a group header and footer, first open the report in Design view. If necessary, click on the Group & Sort button in the Grouping & Totals group. In the Group, Sort and Total pane, click on the More arrow. Click to select with a header section. Click to select with a footer section. To add a title to the header, click on the with title click to add button. In the Zoom box, type the name of the group header. Click on the OK button. The group header is inserted. To add a totals function for a group, display the report in Layout view. Click on the Formatting tab under the Report Layout Tools. Click on the field you want to use with a Totals function. In the Grouping & Totals group, click the Totals button and select the function you want to use. The function is added to the footer of each group. WWP Learning and Development Ltd Page 65

70 To create a group summary in a report, first open the report in Design view. Click on the Design tab below the Report Design Tools tab. In the Controls group, click on the Text Box button. Click in the Group footer section. In the text box, type the expression you want to use. Alternatively, you can open the Property Sheet and type the expression in the Control Source box for the new control ( use the Zoom box by pressing the [Shift and F2] keys). Enter the description you require in the Label box. The report displays the result of the expression. CREATING A RUNNING SUMMARY In a grouped report, you can create a running summary of the items in the group. A running summary can provide a cumulative total for all the groups above. Often, the running summary is positioned in the group footer, which appears at the bottom of every group. For example, in a sales report grouped by region, you can create a calculated field that displays information in a running summary. After each group, a cumulative total for all the groups above appears. To create a running summary, first open the report you intend to use in Design view. Place a text box control in the group footer. Enter descriptive text in the label box of the new control. Enter the expression you need in the text box. Open the Property Sheet. Click on the Data tab. Click on the Running sum box. Select the option you require from the list. The report will display the values you specified. Page 66 WWP Learning and Development Ltd

71 INSERTING A DATE/TIME CONTROL You can insert controls that display the current date and/or time in a report. Each control updates automatically every time the report is previewed or printed. By default, a date/time control is inserted into the Report Header section. However, you can easily move it to another section. The Date and Time dialog box inserts a control that uses the =Date() function to display the current date. If you create a report with the Report Wizard, Access automatically inserts a date/time control in the Page Footer section with the =Now() function, formatted to show the date only in Long Date format. To insert a date/time control in a report, first open the report in Design view. Click on the Design tab under the Report Design Tools tab. Click on the Date & Time button in the Controls group. In the Date and Time dialog box, select the options you require. Click on the OK button. The date will be displayed at the top right of the report. Drag the date function control to the desired location. INSERTING A PAGE BREAK When you print a report, Access automatically starts a new page when necessary. You can control the pagination by inserting a page break. You can insert a page break in the Group Footer section to place each group on its own page, or you can insert a page break in the Report Header section to create a separate title page for a report. To insert a page break, first open the report you intend to work with in Design view. In the Controls group, click on the Page Break button. Click on the report (usually in a footer) to place the page break. WWP Learning and Development Ltd Page 67

72 CHANGING THE REPORT MARGINS There are three standard settings for the report margins any one of which can be selected by clicking on the Page Setup tab and then clicking on the Margins button. You can also control the margin settings to fit more or less data on a page as necessary. The margins you set for a report are saved and applied each time you print the report. To change the report margins, first open the report in either Design or Layout view. Click on the Page Setup tab. Click on the Page Setup button. In the Page Setup dialog box, if necessary click on the Options tab. Set the margin values you require. Click on the OK button. Page 68 WWP Learning and Development Ltd

73 CREATING A REPORT WITHOUT USING A WIZARD You can create a report from scratch in Design view. For example, if a report does not currently exist for a particular table or query, you can create one using the fields in the selected table or query. You can then determine the design of the report by adding fields, control, and options. To create a blank report, first click on the Create tab. In the Reports group, click on the Blank Report button. A blank report is displayed with the Field List on the right. Select the table from which you require fields for the report. Drag the fields you require to appropriate positions on the report. Format the report as required with headers and footers, etc. Click on the Save button in the Quick Access Toolbar. Close the report. WWP Learning and Development Ltd Page 69

74 EXERCISE - USING ADVANCED REPORT DESIGN 1. Open Train18x. 2. Create a blank report in Design view based on the Project table. 3. Change to Design View. 4. Add the Client ID field to the 2.5cm (1") mark on the horizontal ruler in the Detail section. Below the Client ID field, add the Course Name, Trainer Initials, and Students fields to the report at the 7.5cm (3") mark on the horizontal ruler in the Detail section. 5. Display the report header and footer. Using the toolbox, add a label to the left side of the report header. Enter the text Client Information. 6. Preview the report. Then, close the report and save it as Client Info. 7. Open the Project Information Report in Design view. 8. Add a calculated control below the Trainer Initials text box to calculate the profit margin of each project. The calculation should use the following formula: =[Total Sale]*.08. Format the calculation as currency. Position the calculated control under the Trainer Initials text box. Change the text in the label to Profit Margin. If necessary, resize the label to view all the text, and then, position it under the Trainer Initials label. 9. Preview the report. Notice the profit margin calculation. Then, switch back to Design view. 10. Sort the report by the Trainer Initials field in an Ascending order and a secondary sort by Project ID in Ascending order. (Hint: Use the first and second rows of the Sorting and Grouping dialog box.) For the Trainer Initials field, include a group header and group footer, group on each value, and keep the whole group together on one page. 11. Move both Trainer Initials controls to the Trainer Initials Header section. Move the Profit Margin controls up directly below the Total Sale controls. 12. Create a horizontal line above the Project ID controls from 0cm (0 ) to 10cm (4 ) on the horizontal ruler. Then, reduce the size of the Details section by moving the bottom border just under the Profit Margin controls. 13. Preview the report and scroll through the pages. Notice that the trainer initials now appear as a header and the records for each trainer are kept together on a page. Switch back to Design view. 14. Create a new calculated control at the 7.5cm (3 ) mark on the horizontal ruler in the Trainer Initials Footer section that sums the profit margin for projects by each trainer. The calculation should use the following formula: =Sum([Total Sale]*.08). Format the calculated control as currency. Change the text in the label control to Total Profit. Page 70 WWP Learning and Development Ltd

75 15. Create another horizontal line in the Trainer Initials Footer section, above the Total Profit controls, and from 0cm (0 ) to 10cm (4 ) on the horizontal ruler. Then, preview the report. 16. Switch back to Design view and change the Total Profit calculated control to a running summary for each group. 17. Preview the pages of the report. Notice that the total profit calculation is now cumulative for each trainer. 18. Switch back to Design view. Display the Report Header/Footer section. 19. Insert the date only using the default date format Move the date control to the Page Footer section. 20. Adjust the top and bottom page margins to 2cm (.75"). 21. Preview the report to see the new margins. Notice that the date appears on each page of the report. Close the report, saving the changes. 22. Use the Label Wizard to create labels based on the Trainer table. Use the Avery L7163 labels and the default font and colour settings. Include the First Name and Last Name fields, separated by a space on the same line. Sort the labels by the Last Name and First Name fields. Use Labels Trainer as the name of the report. 23. Close the labels report after viewing it. 24. Close the database file. WWP Learning and Development Ltd Page 71

76

77 USING CHARTS INTRODUCTION Charts and graphs enhance data presented n forms and reports by summarizing and illustrating information in a graphical form. Using graphs and charts, readers can easily analyse trends and comparisons. You can create a chart from data in a table or query using the Chart Wizard. The Chart Wizard assists you in creating charts quickly. Charts can be either two or three dimensional, depending on the type and amount of data you need to represent. The message a chart conveys should be clear, and you should avoid providing too much information. 10 In this lesson, you will learn how to: Create a chart Change the chart type Add a chart to a form or report Format chart objects Change the chart title Format the chart title Add data labels to a chart Access includes a number of charts from which you can choose. The Chart Wizard provides a description of each chart type to assist you in selecting the appropriate type for the data you are using. WWP Learning and Development Ltd Page 73

78 To create a chart, first create a blank form or report if you are creating a free standing chart, otherwise if you want to embed the chart in an existing form or chart, open the form/report in Design view. Click on the Design tab. In the Controls group, click on the Insert Chart button. Drag the mouse to create a rectangle the size of the chart you intend to create. In the Chart Wizard dialog box, click on the table or query you wish to use in the chart. Click on the Next button. In the Available fields: list, select the field containing the data you want to use and transfer it to the Fields for chart: list. Click on the Next button. Click on the type of chart you want to display. Click on the Next button. Make any layout changes you want. Click on the Next button. Enter a name for the chart and choose whether to display a legend. Click on the Finish button. Page 74 WWP Learning and Development Ltd

79 CHANGING THE CHART TYPE After creating a chart, you may decide to display the data more effectively with another type of chart. You can change the chart type in the Microsoft Graph window by double-clicking on the chart you want to change. Access includes a number of chart types from which you can choose. To change a chart type, first open the form/report in Design view. Double-click on the chart. Click on the Chart type button list arrow. OR Click on the Chart menu and select Chart Type Select the type of chart you want. You can also use the Datasheet below the chart to change the values if necessary. FORMATTING CHART OBJECTS Chart objects are the elements which make up the chart. Any one of a data series, a title, a legend, or an axis is an element. When any one of these is selected it can be formatted. To select a chart object, open the report/form in Design view. Double-click on the chart. Either click on the object OR Click on the Chart Objects list arrow. Click on the item to select it. WWP Learning and Development Ltd Page 75

80 To format a chart object, first open the required form or report in Design view. Double-click on the chart object you want to format. Click on the tab pertinent to the options you want to use. Select the options to apply. Click on the OK button. To customise a chart, first open the required report or form in Design view. Double-click on the chart. Click on the Chart menu. Click on the Chart Options item. Click on the tab for the item you want to customise. Make the changes you want. Click on the OK button. Page 76 WWP Learning and Development Ltd

81 To change the view of a 3-D chart, first open the required form or report in Design view. Double-click on the chart. Click on the Chart menu. Click on 3-D View Change the elevation or rotation as required. Change the chart height if required. Click on the OK button. FORMATTING THE CHART TITLE You can format the chart title, changing the pattern, font, and alignment of the chart title. The pattern of the chart title controls the type of border around the title, if any, and the background color of the title. The font controls the appearance of the chart title text, such as font type, style, and size. The alignment of the chart title controls where the title text appears relative to the chart, as well as the orientation of the title text. To change or format the chart title, first open the required form/report in Design view. Double-click on the chart. Click on the chart title and then click again to enter the edit mode. Change the title as required. To format the chart title, click on the title once. Click on the format menu. Click on Selected Chart Title In the Color dialog box, click on the appropriate tab. Make changes as required. Click on the OK button. WWP Learning and Development Ltd Page 77

82 ADDING DATA LABELS TO A CHART You can add data labels to a chart which identify the data displayed in the chart. They differ from the legend in that they are placed on the pieces of the chart, rather than in a key beside it. Data labels can display amounts and percentages from the chart data. You can use data labels to present a more detailed and effective chart. To display data labels, first open the form or report containing the chart you wish to modify. Double-click on the chart. Click on the Chart menu. Click on Chart Options Click on the Data Labels tab. Select the option(s) you require. Click on the OK button. Page 78 WWP Learning and Development Ltd

83 EXERCISE - USING CHARTS 1. Open Train27x. 2. Display the Reports object list in the Navigation pane. 3. Open the Project Information Report in Design view. 4. Extend the Report Header down to 7 cm. The new chart will be located in this section. 5. Using the Chart Wizard (Hint: click the Insert Graph button in the Control group of the Design tab on the Ribbon), select the Sales table, and include the Cost field to create a Pie Chart. Select None instead of Sum of Cost (Hint: double click the field and change it). Choose No Field in the Report fields and Chart fields. Accept the default title for the chart and select not to display a legend. Select to open the report with the chart displayed on it. 6. Change the chart type to Column. Select the Clustered Column sub-type, if necessary. 7. Change the chart title to Sales Reps. 8. Apply the Bold Italic style and a 12 point font size to the chart title. 9. Add data labels that show the actual values represented by the chart. 10. Size and position the chart as necessary to view the values. 11. Preview the report. 12. Close and save the report as Sales Report. 13. Close the database file. WWP Learning and Development Ltd Page 79

84

85 USING SUBFORMS/SUBREPORTS INTRODUCTION You can display a form/ report within a form/ report. The main form/ report includes information from one table and the subform/ subreport includes information from a second, related table. You can show a form or report within a form/ report to more effectively show the linked data from tables with one-to-many relationships. The main form/ report and the subform/ subreport are linked by a common field between the tables. The main form/ report represents the one side of the one-to-many relationship and the subform/ subreport represents the many side. When viewing a record in the main form/ report (one side relationship), the subform/ subreport displays the related records from another table (many side relationship). 11 In this lesson, you will learn how to: Work with subforms/subreports Create a subform/subreport Edit the layout of a subform Display a subform in Datasheet view Display a subform total Subform data can be displayed in either Form view (one record at a time) or Datasheet view (many records displayed at once), while subreport data can only be displayed in Print Preview. You can also create and display subform data in a PivotTable or PivotChart. You can add any number of subforms/ subreports to a form/ report as well as add a subform/ subreport within another subform/ subreport. You should keep in mind that the purpose of a form/ report is to make viewing and entering data easier. You can avoid cluttering the form/ report (which can cause confusion) by positioning the subform(s) or subreport(s) carefully, assigning a different background color to each, and removing any unnecessary items, such as scroll bars. Viewing the properties of the subform/ subreport is helpful when considering these options. The SubForm/ SubReport Wizards provide the easiest method for creating a subform subreport. If you choose not to use the SubForm/ SubReport Wizards, you will need to design a form/ report and then insert it into another form/ report. You may not want to use the wizard if you are designing a subform/ subreport that is very different in appearance from the form report the wizard produces. When you add a subform/ subreport to an existing form, it is best to start by creating the main form/ report before you create the subform/ subreport. The form/ report can then be edited so that it contains only the information you need, as well as the desired layout. This form can be added to the design of the main form where it will take on the properties of a subform or subreport. WWP Learning and Development Ltd Page 81

86 To create a subform, first open the form you want add a subform to in Design view. Click on the Design tab under the Form Design Tools tab. In the Controls group, click on the Subform/subreport button. Drag to create a frame for the subform. In the Subform Wizard, select the data options you want. Click on the Next button. Select an option for the fields which link the form. Click on the Next button. Enter the name for the subform. Click on the Finish button. The subform is displayed relating to the main form. Page 82 WWP Learning and Development Ltd

87 EDITING THE LAYOUT OF A SUBFORM In order to improve the efficiency or appearance of a subform/ subreport, you can change its layout the same way you would change the layout of a form/ report. In Design view for the main form/ report, the subform/ subreport is a control that you can move, resize, align, add, and delete as you would any other control. Since the subform/ subreport control contains a form/ report, you can open it in Design view and make any editing changes to its controls. Any changes to the layout of the subform/ subreport are performed in Design view. You can open a subform into a separate Design window by right-clicking the desired subform and then selecting the Subform in New Window command from the shortcut menu. To edit the layout of a subform,first open the form in Design view. Select the control you intend to edit. Make the necessary changes. Save and close the form. DISPLAYING A SUBFORM IN DATASHEET VIEW You can display a subform in Datasheet view. This option allows you to view many subform records at once, rather than viewing them one at a time in Form view. Since the benefit of using subforms is to display the many side of a one-to-many relationship, Datasheet view is sometimes preferred. To display a subform in Datasheet view, first open the form in Design view. Click on the subform to select it. In the Views group, click on the View list arrow. Click on Datasheet view. The subform data is displayed in Datasheet view. WWP Learning and Development Ltd Page 83

88 DISPLAYING A SUBFORM TOTAL Forms and reports often include totals of the information they contain. These totals are easily created by adding a calculated control to the form or report that contains an expression to find the desired total. Expressions are used to obtain information you cannot obtain directly from the tables in your database. For example, if you have a table that contains the quantity and cost of various items, you could use an expression to multiply the quantity and the cost to obtain the current inventory value. Every time you use a form/report, Access calculates any expressions contained in the form/report, helping you keep your information as accurate as possible. Some examples of expressions are listed in the following table: Control Name Expression Result Total =[Cost]+[Shipping]+[Markup] Adds the value of the Cost field, the value of the Shipping field, and the value of the Markup field of an item to produce the Total field Discount =[Price]*.15 Multiplies the Price field of an item by a constant discount of 0.15 Date =Date() Provides the current date in your computer system You may want to include a total of information, contained in a subform/subreport, in the main form/report total. For example, an Orders form may contain a control for shipping charges. The information in the Product subform may include a total, such as the total cost of all the products ordered. You can display this subform total on the main form so that you can add the shipping charges to this total to create a grand total. This option is performed by adding a control to the main form/report, which refers to the desired subform/subreport total control, to display the information. The expression in the main form/report control that refers to the subform/subreport control defines the name of the subform/subreport and the name of the subform/subreport control being used in the following format: = [Name of the Subform/Subreport]![Name of the Subform/Subreport Control] Page 84 WWP Learning and Development Ltd

89 To display a subform total in the main form, first open the required form in Design view. Click on the Design tab under the Form Design Tools tab. In the Controls group, click on the Text Box button. Click in the form where you intend to place the control. Select the label and enter the required text. Click on the text box. If necessary use the Property Sheet to enter an expression for the Control source to relate to the subform control to be used. Alternatively, enter the expression directly in the text box. Close the Property Sheet. The form view shows the total for each order in turn. WWP Learning and Development Ltd Page 85

90 EXERCISE - USING SUBFORMS/SUBREPORTS 1. Open Train28x. 2. Open the Invoice Form in Design view. 3. Use the SubForm Wizard to create a subform in the bottom center of the form. 4. Insert the existing Project Form as a subform. 5. Select the appropriate option from the list box to link the main form and subform by the Project ID field. Name the subform Project Info. 6. Delete the subform s label box. 7. Size and position the subform control so that all the fields appear, if necessary. 8. Switch to Form view to see the subform. 9. Close the database file. Page 86 WWP Learning and Development Ltd

91 WORKING WITH INDEXES INTRODUCTION You can use indexes to help Access perform quicker sorts and searches. An index in Access is a data structure which stores the sort order of a table based on the indexed field(s). When a table is sorted by an indexed field, Access uses the index to sort the table very quickly. It is helpful to index fields that are often used to search or sort the table data. Where a field contains many different values indexing can significantly speed up queries. You should index the fields you use regularly to sort or search for data. You cannot create an index for Memo, OLE, or Hyperlink fields. 12 In this lesson, you will learn how to: View indexes Create a single field index Create a multiple field index Delete an index Create a multiple field primary key Indexes have important properties that are listed in the following table: Property Primary Unique Ignore Nulls Description Designates whether or not the index is the primary key for the table. In other words, this property designates whether or not the data in the indexed field will be used to uniquely identify each record. If this property is set to Yes, the Unique property must be set to Yes. Designates whether or not the values in the indexed field must be unique for each record. You can set this property to Yes without setting the Primary property to Yes. Determines whether or not records with null values in the indexed field are included in the index. The default setting is No, which means that null values are included. WWP Learning and Development Ltd Page 87

92 To view indexes, first open the database you want to work with. Open the table, in Design view, whose indexes you wish to view. Click on the Design tab under the Table Tools tab. In the Show/Hide group, click on the Indexes button. The Indexes box is displayed. CREATING A SINGLE FIELD INDEX You should index at least one field for each table to maximize performance. You should select a field you are likely to use in searches and sorts. When you change the Indexed property of a field to Yes, you can choose whether or not to allow duplicates. If you choose the No Duplicates option, Access will not allow duplicate values to be entered into the field. To create a single field index, first display the required table in Design view. Click on the field you require to be an index. In the Field Properties pane, click on the list arrow of the Indexed box. Select the option you require. Page 88 WWP Learning and Development Ltd

93 CREATING A MULTIPLE FIELD INDEX If you often search on a combination of fields, you can create an index on multiple fields to speed up the searches and sorts. For example, if you want to sort customers in order by region and alphabetically within each region, you can create an index on the Region and Customer fields. You must create a multiple field index in the Indexes window. All the fields you want to include in the index should be listed under the same index name. You can include up to ten fields in an index. To create a multiple field index, first open, in Design view, the database table you wish to work with. Click on the Design tab under the Table Tools tab. In the Show/Hide group, click on the Indexes button. Click in the first blank field in the Index Name column. Type the name of the index. In the Field Name column, click on the list arrow. Click on the field you want to index. In the Sort Order column, click on the list arrow to choose the sort you require. Select the next blank box in the Field Name column. Select the field you want to index. In the Sort Order column, click on the list arrow to choose the sort you require. Repeat adding more fields as required to the index. Close the Indexes box. WWP Learning and Development Ltd Page 89

94 DELETING AN INDEX Indexes take up disk space and can slow down the process of adding, editing, and deleting records. In fact, if there are a limited number of different values in a field, the sort or search speed is not significantly increased by indexing the field. Therefore, you can delete any unwanted indexes to increase efficiency. To delete an index first open, in Design view, the database table you wish to work with. Click on the Design tab under the Table Tools tab. In the Show/Hide group, click on the Indexes button. Click on the row selector to the left of the row containing the index you intend to delete. Press the [Delete] key. Close the Indexes box. Page 90 WWP Learning and Development Ltd

95 CREATING A MULTIPLE FIELD PRIMARY KEY There are times when it is not possible to uniquely identify fields with the values in a single field. Therefore, Access allows you to create a primary key using multiple fields. When you set a primary key using multiple fields, the combination of the information in the fields must be unique. For example, you have a table that contains line items for customer orders. The order number is entered for each customer. Because you will most likely have multiple customers with multiple orders, the order number associated with each customer may not be unique. Also, a particular item number may appear in multiple orders. Therefore, the item numbers may not be unique. Thus, you cannot create a primary index on either of these fields by themselves. The solution is to create a primary key index on both fields, To create a multiple field primary key, first open the required database table in Design view. If necessary, click on the Design tab below the Table Tools tab. Click on the row selector to the left of the row containing the first field for the primary key. Hold the [Ctrl] key and click on the row selector for the second primary key field. In the Tools group, click on the Primary Key button. Click on the Indexes button to see the multiple primary key. which allows each item to appear only once on each order. WWP Learning and Development Ltd Page 91

96 EXERCISE - WORKING WITH INDEXES 1. Open Train31x. 2. Open the Invoice table in Design view. 3. Index the Client ID field, allowing duplicates. 4. Open the Indexes window. 5. Create a multiple field index called Client/Project. The first field in the index should be Client ID and the second field should be Project ID. Use the Ascending sort order for both. 6. Close the Indexes window. Then, close the Invoice table without saving the changes. 7. Open the Project table in Design view. 8. Open the Indexes window and delete the existing indexes. Close the Indexes window. 9. Create a multiple field primary key that includes the Project ID and Client ID fields. 10. Open the Indexes window to view the primary key fields. Then, close the Indexes window. 11. Close the Project table without saving the changes. 12. Close the database file. Page 92 WWP Learning and Development Ltd

97 WORKING WITH MACROS INTRODUCTION A macro performs a set of commands in sequence. While macros in word processors and spreadsheets are used mainly to duplicate keystrokes or mouse movements, macros in Access often automate an action or a series of actions. Such actions include opening tables, printing forms, finding records, or applying filters. Macros can even be used to add command buttons, and build complete applications. Macro commands in Access consist of an action and its arguments. The action is the task to be performed, such as opening a form. The arguments determine the specifics for the action, such as which form to open. You create a macro in Access using the Macro Builder window. This window has two panes. The upper pane, called the Action pane, contains a design grid. The design grid can contain up to five columns. The Action, Argument, and Comment columns are always displayed. The Action column contains one of the many available macro commands. The Arguments column is for display only and can be hidden by clicking on the 13 In this lesson, you will learn how to: Work with macros Open the Macro Builder window Create a macro Assign an argument to an action Save a macro Use single step mode for testing Run a macro Edit an existing macro Create a macro for an event Arguments button in the Show/Hide group. Arguments must be entered in the Action Arguments pane. In the Comment column, you can type a description of the action. You can also display the Macro Name and Condition columns. The Macro Name column contains a name for a macro that can be referred to during events, such as clicking a command button. You can execute a macro conditionally by adding a statement to the Condition column. The lower pane, called the Action Arguments pane, contains the arguments. The arguments listed change, depending on what action is selected. The right side of the Action Arguments pane displays helpful information about the selected action or action argument. WWP Learning and Development Ltd Page 93

98 To open the Macro Builder window, first open the database you intend to work with. Click on the Design tab. In the Other group, click on Macro. The Macro Builder window is displayed. CREATING A MACRO A macro includes actions. You place each action in a separate row in the design grid in the order in which they are to be performed. For example, a Maximize command maximizes the window opened in the step immediately preceding it. You use the Comment column to enter a description of the action to be performed. This field can contain up to 255 characters. While comments are optional, it is beneficial to enter a description of the action. This field is helpful if you want to modify the macro at a later time. To create a macro, first click on the Create tab. In the Other group click on the Macro button. In the Macro builder, select the first blank field in the Action column. Click on the list arrow. Click on the action you want to use. Press the [Tab] key (or the [Enter] ) key twice. In the Comments column, if required, enter a comment to explain the action. Enter further actions and comments as required. When you close the Macro builder, you will be prompted to save the macro. Page 94 WWP Learning and Development Ltd

99 ASSIGNING AN ARGUMENT TO AN ACTION Most actions have a default list of available arguments. For action arguments without a list, you can type the argument into the argument field. You can enter up to 255 characters into the argument field. Some arguments are required. For example, you must select the Form Name argument for the OpenForm action. Other arguments, such as Filter Name, are not required for the OpenForm action. If a required argument is missing, the macro stops when the action containing the missing argument is encountered. In some cases, a default argument is used. For example, the View argument defaults to Form for the OpenForm action. Other arguments are ignored if they are not selected. With forms, you can also specify a Where Condition argument. This argument acts as a filter, without using an actual query. For example, the argument [Credit Limit] = 1000 limits records to those with a credit limit of You can type the condition directly into the argument box or click the Build button in the argument box to open the Expression Builder dialog box. Access displays a helpful message explaining the selected argument to the right of the argument boxes. If you press the [F1] key while the insertion point is in the Action Arguments pane of the Macro Builder window, a help window for the argument opens with additional information. To assign an argument to an action, first open the required macro in Design view. Select the action in the Action column to which you want to assign an argument. Select the applicable argument in the Action Arguments pane. Type the argument or select the corresponding list arrow. If applicable, select an argument from the list. Add other arguments to the action as required. SAVING A MACRO After creating a macro, you must save it before you can test or run it. When you attempt to save a macro or close the Macro window without saving, a Save As dialog box opens with the default name of Macro# (numbered consecutively). The name that you give the macro appears in the Macros Navigation pane. WWP Learning and Development Ltd Page 95

100 You can rename a macro. However, if you rename a macro, it may no longer run, depending on how you initiate the macro. Instead, it is a good idea to copy a macro, rename it, and then edit it in order to create macros that perform similar tasks. To save a macro, first create the required macro. Click on the Save button on the Quick Access Toolbar. In the Save As dialog box, enter a name for the macro. Click on the OK button. USING SINGLE STEP MODE FOR TESTING A MACRO Access runs macros so quickly that you may not be able to see each action as it is performed. If you wish to confirm that the actions are being performed correctly, you can step through the macro. Single step mode is particularly useful when a macro contains numerous actions or arguments, or when a macro does not seem to perform as planned. When you step through a macro, Access pauses before each action, allowing you to view each step. The Macro Single Step dialog box opens, displaying the macro name, condition, action name, and selected arguments. The Macro Single Step dialog box has three buttons: Step, Stop All Macros, and Continue. You select the Step button to perform the action in the dialog box. If there are no errors, the next action appears in the dialog box. If you want to stop running the macro in this mode, you select the Stop All Macros button. The macro stops running and the dialog box closes. When you want to stop stepping through the macro and run the remaining steps, you select the Continue button. The remaining macro actions are then completed. You should only use single step mode when working in the Macro Builder window. When you enable single step mode, it remains activated throughout the current Access session. All macros will run in single step mode until the mode is disabled. If an error does occur, you can make the changes in the Macro Builder window. After you make the changes to a macro, you should retest it. Page 96 WWP Learning and Development Ltd

101 To test a macro step by step, first open the macro you want to run in Design view. Click on the Design tab below the Macro Tools tab. Click on the Single Step button. Click on the Run button. Click on the Step button to perform the first action in the macro. Repeat as necessary until the macro finishes. If the macro encounters an action it cannot perform, a message box is displayed stating the action it could not carry out. Click on the Stop All Macros button to stop the macro. When you have finished testing and correcting the macro, click on the Single Step button to de-activate step mode and allow the macro to run normally. RUNNING A MACRO You can run a macro from the Navigation pane by selecting the macro name and using the right mouse button to click, thus opening the shortcut menu, and clicking on the Run item. You can also run the macro when in the macro is displayed in Design view. A warning box opens if required arguments are missing or if the macro cannot run for any reason. To run a macro from Design view, click the Run button in the Tools group of the Design tab on the Ribbon. To run a macro from the Navigation Pane, double-click the macro name OR right-click the macro name and select Run from the shortcut menu. WWP Learning and Development Ltd Page 97

102 EDITING AN EXISTING MACRO After you have created a macro, you may decide to add or delete existing actions or change actions or action arguments. In the Macro Builder window, you can cut, copy, and paste to edit a macro. You can also insert and delete rows. After you make the desired changes, you must save the macro to save the changes. It is a good idea to test the edited macro using single step mode. You must remember to disable single step mode after testing a macro. To edit an existing macro, in the Navigation pane, use the right mouse button to click on the macro you want to edit. From the menu, select Design view. Change the actions and arguments you want to change. To insert a row, click on the row where you want the new row to be located. In the Rows group, click on the Insert Rows button. To delete a row, click on the row you want to be deleted. In the Rows group, click on the Delete Rows button. Click on the Save button on the Quick Access Toolbar. Click on the Close button. RUNNING A MACRO FROM THE DATABASE TOOLS RIBBON You can run a macro using the Database Tools ribbon. This option allows you to execute a macro from almost anywhere. When the Run Macro dialog box opens, you can either type the name of the macro in the text box or select the macro name from a list. To run a macro from the Database Tools ribbon, first click on the Database Tools tab. In the Macro group, click on the Run Macro button. In the Run Macro dialog box, enter or select the macro you want to run. Page 98 WWP Learning and Development Ltd

103 CREATING A MACRO FOR AN EVENT You can create a macro using the Macro Builder from the Property Sheet. This method is used when you want to associate a macro with an existing object or control. You can also create macros using the Expression Builder, or in VBA code if you wish to. Creating a macro using this method requires that you associate the macro with an event, such as On Click or On Close. When you select an Event property, the Build button appears. The Build button gives you access to the Macro Builder. To create a macro associated with an object, first open the required form/report in Design view. Click on the object you intend to associate the macro with. Click on the Design tab below the Form/Report Design Tools tab. In the Tools group, click on the Property Sheet button. In the Property Sheet, select the Event tab. Select the desired Event property. Click on the Build button. In the Choose Builder box, click on Macro Builder. Click on the OK button. Create the macro, saving and naming it. The macro is now linked to the object and will run when that event occurs. WWP Learning and Development Ltd Page 99

104 EXERCISE - CREATING MACROS 1. Open Train34x. 2. Create a new macro. Enter the following actions and comments: Action OpenForm MoveSize OpenForm MoveSize Comment Opens the Invoice Form Sizes the Invoice Form and positions it at the top of the window Opens the Payment Form in Datasheet view Sizes the Payment Form and positions it below the Invoice Form 3. Enter the following arguments for each action: Action OpenForm Arguments Form Name: Invoice Form Data Mode: Read Only MoveSize Right: 0cm (0 ) Down: 0cm (0 ) Width: 15.5cm (6 ) Height: 7.5cm (3 ) OpenForm Form Name: Payment Form View: Datasheet Data Mode: Read Only MoveSize Right: 0cm (0 ) Down: 7.5cm (3 ) Width: 15cm (6 ) Height: 5cm (2 ) 4. Save the macro as Open Invoice/Payment Forms. 5. Enable single step mode and run the macro to test it. 6. Correct any errors, close the forms and return to the macro Design view. 7. Edit the macro. In the second step, MoveSize, change the Height argument to 5cm (2 ). In the fourth step, MoveSize, change the Down argument to 5cm (2 ). 8. Disable single step mode then Save the macro and close the Design window. 9. Run the Open Invoice/Payment Forms macro using the Run Macro button in the Database Tools Ribbon. 10. Close the forms. 11. Create a new macro that closes the Invoice Form and the Payment Form (Hint: you will need two separate actions for this). Save the macro as CloseForms and close the macro design window. Page 100 WWP Learning and Development Ltd

105 12. Open the Invoice Form in Design view. 13. Assign to the Close Forms command button, the CloseForms macro created previously (Hint: open the Property Sheet and look for the OnClick event). 14. View the form and test the command button. The Payment form should open. 15. Close all open forms and save the changes. WWP Learning and Development Ltd Page 101

106

107 FURTHER MACROS INTRODUCTION Properties allow you to specify the appearance and behaviour of objects in a database. Objects include tables, queries, forms, and reports, as well as controls within reports or forms. Property sheets display the properties of a selected object. They have several tabs including Format, Data, Event, and Other that list the properties by group. The groups are the same for every property, but the items in the group change depending on the type of object selected. The All page displays all the properties in a single list. The Format properties allow you to control the appearance of an object, such as colour, font, size, and borders. These properties change automatically when you make changes to an object. The Data properties allow you to specify the source of the data and control items, such as default values. The Event properties allow you to control when an action occurs. The Other properties contain items that do not fit into the other three categories, such as the name of a control when used in a macro or text that appears in the status bar. 14 In this lesson, you will learn how to: Assign a macro to a control Assign a macro a command button Add a condition to a macro Create a group macro Create an Autoexec macro WWP Learning and Development Ltd Page 103

108 ASSIGNING A MACRO TO A CONTROL You can associate a macro with a control on a form or report using the Event properties of the control. An event is an action, such as a mouse click or a change in value that can initiate a response. The macro runs automatically when the specified event involving that control occurs. Many events involve the control having the focus. Focus means that the control can receive data from mouse clicks or keyboard actions. For example, field boxes, toggle buttons, and radio buttons can have the focus, since they can respond to data entry from the keyboard or mouse. Only one control can have the focus at a time. By linking a command button or a control with a macro, you can make commonly used functions easier. Initiating macros this way is particularly useful because it does not require the user to know or use the Access menu structure. For example, you could associate a macro with a command button on a form to print a report. The user could then print the report by clicking the command button, without having to open the report or know the correct menu commands. To assign a macro to a control, first open the desired form in Design view. Click on the control you want to attach a macro to. If necessary, click on the Property Sheet button to display the Property Sheet. In the Property Sheet, click on the Event tab. Select the required property. Use the list arrow to select the macro you want to use. If required, close the Property Sheet. When the form is open, clicking on the designated control will run the macro. Page 104 WWP Learning and Development Ltd

109 ASSIGN A MACRO TO A COMMAND BUTTON Command buttons are controls to which you can assign actions. They are often used to run macros in a form or report. You can place descriptive text or a picture on a command button so that the user can easily identify the purpose of the button. You create a command button in Design view using the Command Button tool in the toolbox. After you create the command button on the form, you set the properties, such as the event property to initiate the action and the text or picture to appear on the button. To create a command button in which a macro will be attached, it is recommended that you disable the Control Wizards button in the toolbox. To create a command button that is attached to a macro, first open the required form in Design view. Click on the Design tab below the Form Design Tools tab. In the Controls group, click on the Button button. Click in the location where the button is to be located. If necessary, open the Property Sheet. Click on the Event tab. Select the required property. Click on the list arrow and select the required macro. Click on the All tab. In the Name box, enter a suitable name. In the Caption box, enter the text to be displayed on the button. If necessary, close the Property Sheet. When clicked on, the button in the form will operate the macro. WWP Learning and Development Ltd Page 105

110 ADDING A CONDITION TO A MACRO You can add a condition argument to a macro. An argument acts very much like a filter. Just as a filter displays only the records that meet the condition, the argument only performs the macro when the condition is met. Before you can add a condition to a macro, you must display the Condition column in the Macro Design window. The Condition column appears to the left of the Action column in the upper pane of the Macro Builder window. You can type a condition or use the Expression Builder dialog box to create the expression. If you type an expression, there are certain rules you must follow when referring to controls in tables, queries, forms, and reports. All references must be separated with an exclamation point. Additional rules for the database objects and controls are listed in the following table: Controls Controls in tables Controls in queries Controls in forms Controls in reports Rules Enclose the name of the table and the name of the control in square brackets and separate them with an exclamation point. For example, [Orders]![Customer ID] refers to the Customer ID field in the Orders table. Enclose the name of the query and the name of the control in square brackets and separate them with an exclamation point. For example, [Order Items]![Item Number] refers to the Item Number field in the Order Items query. Enclose the name of the form and the name of the control in square brackets and separate them with an exclamation point. Indicate that you are referring to a form by beginning the statement with the word Forms. For example, Forms![Customers]![Customer ID] refers to the Customer ID field in the Customers form. Enclose the name of the report and the name of the control in square brackets and separate them with an exclamation point. Indicate that you are referring to a report by beginning the statement with the word Reports. For example, Reports![Customer Sales]![Contact Name] refers to the Contact Name field in the Customer Sales report. Since you enter the condition in the Condition column in the Macro Builder window, you do not need to include the word IF in the statement. Access assumes the statement is a condition. If the condition is true, Access performs the corresponding action in that row. If the condition is false, Access does not perform the action. You can also create an expression using the Expression Builder when you display the Condition column by right-clicking in the Condition column and then selecting the Build command, by right-clicking in the Action Arguments pane and then selecting the Build command, or by clicking the Builder button on the Macro Design ribbon. If the condition is true, you can have Access perform more than one action by entering an ellipsis (...) in the Condition column in the Macro Builder window. Access performs the action on the same row as the condition and all rows thereafter that contain an ellipsis. Page 106 WWP Learning and Development Ltd

111 To add a condition to a macro, first open the required macro in the Design view. If necessary, click on the Design tab under the Macro Tools tab. In the Show/Hide group, click on the Condition button. Click in the Condition box. Type the condition in the box. CREATING A MACRO GROUP You can place multiple macros on the same macro sheet. This option, called grouping macros, has several advantages. The most obvious advantage is that it reduces the number of macros that appear in the window. More importantly, it allows you to organize your macros by grouping related macros together onto a single macro sheet. For example, if you created several macros that are related to one form, you can group all of them together on one macro sheet. Before you can create a group macro, you need to display the Macro Name column in the Macro Design window. The Macro Name column appears to the left of the Action or Condition column, if it is displayed. You can type the macro name directly into the appropriate field in the Macro Name column. Like any other macro, a group macro must be saved with a name. You should make sure that the group macro name is descriptive enough to indicate its contents. This helps other users know what macros are contained in the group macro. For example, if all the macros relate to the Orders form, you could name the group macro Order Form Macros. When macros are grouped, you can still refer to individual macros. To refer to an individual macro in a group, you can use its group and macro name in the format Groupname.Macroname. If you have already created macros, you can cut and paste them into a new group macro sheet or edit an existing macro sheet. WWP Learning and Development Ltd Page 107

112 To create a macro group, first display the macro you want to use in Macro Design view. Click on the Design tab. Click on the Macro Names button. Click in the first blank field in the Macro Name column. Type a name for the macro. In the Action column, select the required action. Insert a comment if required. In the Action Arguments pane, select options as required. Continue for other groups as necessary. Save and close the macro. Page 108 WWP Learning and Development Ltd

113 CREATING AN AUTOEXEC MACRO While you can select a command to run a macro, you can also have a macro that runs automatically when a database is opened. This type of macro is called an Autoexec macro because it is automatically executed when the database is opened and can be used to automate or simplify the database for other users. You can create an Autoexec macro in two ways. You can rename an existing macro Autoexec, or you can create a new macro and save it with the name Autoexec. Since the Autoexec macro is stored with the database, each database can have its own Autoexec macro. However, you can only have one Autoexec macro per database. When necessary, you can bypass the Autoexec macro by holding the [Shift] key while you open a database. To create an Autoexec macro by renaming an existing macro, first display the Macros list in the Navigation pane. Use the right mouse button to click on the macro you intend to rename. Click on the Rename item in the shortcut menu. In the box, type Autoexec. Press the [Enter] key. The next time that database is opened the macro will run automatically. WWP Learning and Development Ltd Page 109

114 EXERCISE - FURTHER MACROS 1. Open Train35x. 2. Rename the Open Payment/Invoice macro to Autoexec. Make sure that you press [Enter] after you rename it. Close the database and reopen it to test the macro. Notice that the two form windows open. Close the form windows. 3. The Balance macro opens a message box warning that there is a balance due for the project. 4. Open the Payment form in Design view. 5. Select the Balance Due bound (text box) control. 6. Open the Property Sheet, if necessary. 7. Assign the Balance macro to the OnGotFocus event. Close and save the form. 8. View the Payment Form. Click the Balance Due text box. Notice that a message box opens. Close the message box. Move through the next several records and notice that the message box opens whether or not there is a balance due. Close the form. 9. Open the Balance macro in Design view. 10. Add a condition to the Balance macro so that the macro only runs when the balance due is greater than 0. Enter the following condition for the macro: Forms![Payment Form]![Balance Due] > Close the macro Design and save the changes. 12. Open the Payment Form in Form view. Click the Balance Due text box. Notice that a message box opens for the first record because there is a balance due (a balance greater that 0). Move through the next several records and notice that the message box only opens when a balance is due. Close the form window. 13. Open the Project form in Design view. 14. Create a command button without using the wizard. Place it in the lower left corner of the form. Assign the View Report macro to the command button so that it runs when the mouse button is clicked. Enter the text Print Project Report in the Caption property box. Resize the button to display all the text, if necessary. 15. Close and save the Project Form. Open the Project Form in Form view and test the Print Project Report command button. Notice that the form prints. Close the form. 16. Create a group macro. Enter the following names, actions, and arguments in the Macro Design window: Page 110 WWP Learning and Development Ltd

115 Macro Name Action Argument Open the form OpenForm Form Name: Client Information Form Print the Report OpenReport Report Name: Client Information Report View: Print Open the Trainer table OpenTable Table Name: Trainer 17. Save the macro as Client Macros. Close the macro Design window. 18. Test then three Client Macros using the Run Macro button in the Database Tools Ribbon. 19. Close the database file. WWP Learning and Development Ltd Page 111

116 EVENTS INTRODUCTION Each control, section and entire object on a form or report has properties. It is the event properties for each of these that can be used to attach either modules or macros. This enables automation, data validation or various other procedures to be started when certain events occur. An event is a specific action which occurs on or with a certain object. Clicking on a button is an event, in this case known as the On Click event. Other events include On Close which is when a form or report is closed and is removed from the screen. If an event is to cause a macro to run, the settings must be made in the Event page of the Property Sheet which can be opened by clicking on the Property Sheet button in the Tools group of the Design ribbon. The Property Sheet can be left open while dealing with different objects in the form/report. 15 In this lesson, you will learn how to: Use Event Properties Use macros to ensure data entry Use macros to automatically fill in fields. When a macro/module attached to a event property will actually run will depend on the event property itself. ENSURING DATA ENTRY By using a conditional macro a field can be tested to see if it contains a correct value. Although this can be done using Validation Rules and the required properties by using a macro the response to a incorrect value can be customised to not only come up with an error message, but also return the user to the appropriate field. Using the MsgBox action can create a custom message box and the GoTo Control action can be used to return the user to the appropriate field. Page 112 WWP Learning and Development Ltd

117 Finding the appropriate event to attach a macro is a important factor to take into account. If the macro to check the value entered was attached to the On Exit property of the field, it would not check the fields contents if the fields was skipped over by the user. Instead if the macro was attached to the Before Update property of the form it will always check the contents of the field before the record is saved. To attach a macro which will ensure data has been entered on a form, first open the required database. Click on the Create tab. Open the required form in Design view. Ensure the Property Sheet is open. Select the object to be used. In the Property Sheet, click on the Event tab. Click on the Before Update property. Click on the Build button. In the Choose Builder box, click on Macro Builder. Click on the OK button. In the Show/Hide group, click on the Conditions button. Enter the necessary condition. In the Action column, select the action you want from the list. Enter further conditions, actions, comments and arguments, as required. In the Close group, click on the Close button. In the message box, click on the Yes button. When the form is run, if the designated field is not filled, the user will be stopped form saving the record until the discrepancy is rectified. Alternatively, a macro can be created and then attached to the required property rather than being attached directly to the property. AUTOMATICALLY FILLING FIELDS By using a conditional macro fields can be automatically filled on a form depending upon the value of another field. The check on the contents of the field can be carried out after the data ahs been entered into the field and the user presses tab or enter to move onto the next field. Thus by assigning a conditional macro to the OnExit property to the field another field can be conditionally filled depending upon the value of the first field. WWP Learning and Development Ltd Page 113

118 By using the SetValue action in a macro a control or a controls properties can be set. Then using the Goto control action the filled control can be bypassed. To create, and add, a conditional macro to automatically fill a field, first open the required database. Click on the Create tab. Click on the Macro button. Click on the Conditions button. Add the required conditions to set the test for the contents of the field. Add any other actions, arguments and comments as necessary. Close, and save, the macro. Open the required form in Design view. Click on the control to be used for the macro. If necessary, open the Property Sheet. Click on the Before Update property. From the list, select the macro to be used. Save the form design. When entry is made in the specified form field, subsequent field(s) will automatically be completed. Page 114 WWP Learning and Development Ltd

119 EXERCISE - EVENTS 1. Open Train10x. 2. Open the New Payments form in Design view. 3. Create a macro that will not allow the macro the record to be saved unless a value greater than 0 is entered in the Amount Paid field, and then returns the user to the Amount Paid text box. Use the table below as a guide: Condition Action Arguments [Amount Paid] <=0 CancelEvent MsgBox Message: A value over 0 must be entered in this field before the record can be saved. Click OK and enter a value or press ESC to cancel updating this record. GoToControl Control name: [Amount Paid] 4. Close and save the macro as CheckPaid. 5. Attach the macro to the form s BeforeUpdate property. 6. View the form. 7. Add a new record as follows: Project ID: 1023 Payment Date: 6/6/95 Amount Paid: 0 Balance Due: Move to the next new record. At this point, Access tries to update the record but before doing so, the macro runs and stops the update. 9. Enter a value of 100 in the Amount Paid text box Move to the next new record. This time, the macro allows the update to take place. 11. Close the form and then close the database. WWP Learning and Development Ltd Page 115

120

121 USING SWITCHBOARDS INTRODUCTION In Access, a switchboard is a form that allows users of a database to get from one place to another or perform several commands from a central location. If a database has a switchboard, it is usually the first item the user sees when the database is opened. While a simple database may have one switchboard, a database with many forms and reports may have several switchboards. A switchboard is basically a form that is not bound to a table or a query. It contains command buttons or other objects that run macros in response to an action by a user. 16 In this lesson, you will learn how to: Open and use a switchboard Create a switchboard form Add a command button to a switchboard Set startup options Creating a switchboard should be one of the last things you do when creating a database. You may want to consult with the people who use the database, or let them use it without a switchboard for a while, so that you can get a better idea of what needs to be automated. There are several ways to create a switchboard. You can use the Switchboard Manager, or start with a blank form. The Switchboard Manager automates the process of making or editing a switchboard. It allows you to make a switchboard the default switchboard so that it appears on startup or branch to other switchboards. When a switchboard is created using the Switchboard Manager, Access creates a table that describes what the buttons on the form display and do. You can also create a switchboard in Design view using a blank form. When you create a form to be used as a switchboard, it should not be bound to a table or query. To ensure that the switchboard does not look or work like a form, you need to set certain properties, such as not displaying navigation buttons and scroll bars. Creating a switchboard using a blank form requires that you add your own command buttons, controls, and graphics, as well as set the desired form properties. WWP Learning and Development Ltd Page 117

122 CREATING A SWITCHBOARD Before creating the switchboard form, you should have an idea what needs to be included. If you are going to use macros to initiate certain actions, you should create them before you start creating the switchboard. Because you do not want the switchboard to look like a typical form, you should set the properties listed in the following table: Property Default View Record Selector Navigation Buttons Auto Center Scroll Bars Auto Resize Setting Single Form No No Yes Neither Yes You may also want to size the switchboard form so that it covers the entire screen. To further enhance the switchboard form, you can change the background color and add text and graphics. To create a switchboard, first open the desired database. Click on the Database Tools tab. Click on the Switchboard Manager button. Click on the Yes button if asked if you want to create a switchboard. In the switchboard Manager box, click on the Edit button. In the Switchboard Name: box, type a name for the main page. Click on the New button. Enter text for the button. In the Command: box, click on the list arrow. Select a command. In the Form: box, click on the list arrow. Select the form you wish to be displayed. Click on the OK button. Continue adding new buttons as required for the switchboard. Click on the Close button. Click on the Close button. Page 118 WWP Learning and Development Ltd

123 ADDING A COMMAND BUTTON TO A SWITCHBOARD Once you have created the switchboard form, you add controls, such as command buttons, to it. As your database changes, you can modify the switchboard, as necessary. To improve the appearance of your switchboard, you can add labels and graphics, change object colors and fonts, and modify other form properties. If a control performs a single function, such as opening a form or printing a report, and the form or report already exists, you can add the control using the Control Wizards. If the form or report has not been created, you can create the control without using the Control Wizards. Then, after the form or report is created, you can assign an action to the control and change any other properties, as desired. When a control performs two or more functions, you should assign the control s action to a macro. As with single function controls, you can use the Control Wizard. This method of assigning control actions to macros is the most common because many switchboard controls perform two actions, such as opening a form and closing the switchboard. A quick way to add a control to a switchboard is to open the switchboard in Design view and drag a macro to it. When you create a control this way, the control action is automatically assigned the On Click event property. To add a command button to a switchboard, first open the switchboard form in Design view. Ensure the Control Wizard button is active. Click on the Button button. Click in the form where you want to insert the command button. Select the required category from the Categories: list box. Select the required action from the Actions: list box. Click on the Next button. Select the appropriate option. Click on the Next button. Designate text or a graphic for the button. Click on the Next button. Enter a name for the button. Click on the Finish button. WWP Learning and Development Ltd Page 119

124 OPENING A SWITCHBOARD AUTOMATICALLY Once you have created the switchboard for your database, you may wish for it to show automatically upon opening the database file. This is achieved either by creating a macro named autoexec that opens the switchboard form (see page 109) or by setting special Access options. In addition to showing the switchboard, you may also wish to hide the Navigation Pane for that file in order to restrict users to just using the functionality offered by the switchboard. This is achieved using Access options. To automatically show a switchboard form upon opening a database file, click the Office button. Click the Access Options... button. Select Current Database in the pane at the left. Click the Display Form dropdown list in the Application Options section. Select the name of the switchboard form. In the Navigation section below, deselect the Display Navigation Pane check box. Click OK. Page 120 WWP Learning and Development Ltd

125 EXERCISE - USING SWITCHBOARDS 1. Open Train36x. 2. Create a blank form. Change the view to Design view. 3. Insert the image, Computer.wmf, at the right of the form. 4. Change the Format properties of the form as shown in the following table: Property Default View Scroll Bars Record Selectors Navigation Buttons Auto Resize Auto Center Setting Single Form Neither No No Yes Yes 5. Close the property sheet. 6. Disable the Control Wizards, if necessary. Add a command button to the upper left corner of the form. 7. Open the property sheet for the command button. 8. On the Event page, set the On Click property to run the Open Payment/Invoice Forms macro. On the Format page, enter the text Open Forms as the caption. 9. Close the property sheet. 10. Create another command button on the form approximately 1.5cm (1/2 ) below the Open Forms button. Open the property sheet for the command button. 11. On the Event page, set the On Click property to run the Customer Macros.Print the Report macro. On the Format page, enter the text Print Report as the caption. 12. Close the property sheet. 13. Enable the Control Wizards. Add another command button to the form approximately 1.5cm (1/2 ) below the Print Report button. 14. In the Command Button Wizard, select the Form Operations category and the Close Form action. Display text on the button that reads Close Switchboard. Name the button Closes Switchboard. 15. Align the buttons, if necessary. Close and save the form. 16. Specify in Access Options for the Switchboard to display upon opening the database file. 17. Close and reopen Train36x. Notice that the switchboard opens. WWP Learning and Development Ltd Page 121

126 18. Test the buttons on the switchboard. Close any open windows, as necessary. 19. Close the database file. Page 122 WWP Learning and Development Ltd

127 CUSTOMISING THE QUICK ACCESS TOOLBAR 15 INTRODUCTION When a Microsoft Office program starts, the Quick Access Toolbar appears at the top of the window, unless the settings have been changed. The Quick Access Toolbar contains only the most popular buttons though you can modify this. The Quick Access Toolbar can be moved below the ribbons and, if necessary, commands can be inserted in the Toolbar. You can also assign macros to buttons on the Toolbar, as well as removing, or adding, buttons and groups. Where necessary, you can minimise the ribbon, placing the commands a user will need on the Quick Access Toolbar. In this lesson, you will learn how to: Move the Quick Access Toolbar Add or remove items from the Quick Access Toolbar Customise the Quick Access Toolbar Assign a macro to the Quick Access Toolbar To move the Quick Access Toolbar, click on the pull down beside the Quick Access Toolbar. In the list, click on the Show Below the Ribbon item. The Quick Access Toolbar will be displayed below the ribbon. WWP Learning and Development Ltd Page 123

128 To add or remove items from the Quick Access Toolbar, click on the Customise Quick Access Toolbar list arrow. Click to place, or remove, the check for that item. To add a ribbon button or group to the Toolbar, use the right mouse button to click on the button/group on the Ribbon. Click on the Add to Quick Access Toolbar item. To remove a button or group, use the right mouse button to click on the button/group on the Quick Access Toolbar. Click on the Remove from Quick Access Toolbar item. Page 124 WWP Learning and Development Ltd

129 To customise the Quick Access Toolbar, click on the Customize Quick Access Toolbar list arrow. Click on the list arrow. Click on the More Commands item. Click on the Choose commands from: list arrow. Click on the item you require. If necessary, click on the Customize Quick Access Toolbar list arrow and click on For all documents (default). Click on the command you want to add from the left column. Click on the Add button. Click on the Move Up and Move down arrow buttons to arrange the commands in the order you want. Click on the OK button. WWP Learning and Development Ltd Page 125

130 ASSIGNING A MACRO TO A TOOLBAR After creating a macro, you can add the macro to the Quick Access Toolbar, simplifying access to that macro. After creating a macro, the macro name is displayed in the list of available commands when the Quick Access Toolbar is customised. A macro button on the Quick Access Toolbar will display the name of the macro when the mouse button is held over the button. To assign a macro to a toolbar, click on the Customize Quick Access Toolbar list arrow. Click on the More Commands item. Click on the Choose command from: list arrow. In the list, click on Macros. Click on the macro you intend to add from the left column. Click on the Add button. Click on the Modify button. In the Modify Button box, type a name in the Display name: box. Click on the icon you want to use for the button. Click on the OK button. Click on the OK button to close the Access Options. The button is displayed on the Quick Access Toolbar. Page 126 WWP Learning and Development Ltd

131 EXERCISE - CUSTOMISING THE QUICK ACCESS TOOLBAR 1. Open Train37x. 2. Close the switchboard. 3. Move the Quick Access Toolbar to a location below the Ribbon. 4. Add the Query Design button to the Quick Access toolbar. 5. Assign the Open Invoice/Payment Forms macro to the Quick Access Toolbar. 6. Run the macro from the Quick Access Toolbar. 7. Remove the Query Design button from the Quick Access Toolbar. 8. Remove the macro button from the Quick Access Toolbar. 9. Close any open windows. 10. Close the database file. WWP Learning and Development Ltd Page 127

132

133 WWP Learning and Development Ltd Page 129

134

135 APPENDIX A - USING ACCESS AND THE INTERNET INTRODUCTION Access 2007 allows you to save tables, forms, and reports as Web documents and the databases can contain links to internet resources, connection to online Help being one useful link. The Web is an enormous arrangement of documents connected together with hypertext links or hyperlinks for short. Using hyperlinks you can retrieve another Web document, called the target of the link. The main advantage of hyperlinks is that you do not have to know where or how the target is stored. The target is identified by its URL or Uniform Resource Locator, which uniquely identifies the location of the target on the internet. Web pages are created in a language called HTML, Hypertext Markup Language, a multi-platform which any operating system can use to access a Web page. In this lesson, you will learn how to: Work with hyperlinks Create a hyperlink field Insert a hyperlink Edit a hyperlink Delete a hyperlink field Import a HTML file Export to a HTML file Use SharePoint WORKING WITH HYPERLINKS Access 2007 supports the use of hypertext within the application. Hypertext, or hyperlinks, are strings of text that declare an address or a path to a document. Hypertext is active in that, if you click it, your PC and/or modem lead you to the document. Hyperlinks provide an electronic path to documents in much the same way as your home address provides a path for the mail you receive. Hyperlinks can be a URL address or a UNC address. The URL (Uniform Resource Locator) is the address of a resource, or file, available on the Internet or your intranet. The URL contains the protocol of the resource (e.g. or ftp://), the domain name for the resource, and the hierarchical name for the file (address). Domain extensions identify the source;.com for companies,.org for organizations,.gov for government, and.edu for educational institutions. CREATING A HYPERLINK FIELD You can add hyperlinks to tables in Design view by adding a field name and identifying it as a hyperlink data type. You can then add hyperlinks to the appropriate column in Datasheet view, allowing you to jump to objects in the same database, in another database, in other Microsoft office documents, on the internet, or on an intranet. WWP Learning and Development Ltd Page 131

136 To create a Hyperlink field in a table, first display the table in Design view. Create a new field in which you want to store the hyperlink. In the Data Type column, click on the list arrow. Click on Hyperlink. Save, and close, the table. INSERTING A HYPERLINK To insert a hyperlink to a file or Web page, first open the object containing the hyperlink field. In Design view, click on the Design tab to use the Insert Hyperlink button. Alternatively, in datasheet, or form view, you can use the right mouse button to click on a hyperlink field and choose Hyperlink from the shortcut menu. Click on the Edit Hyperlink button Locate and specify the linked document in the Edit Hyperlink dialog box. Click on the OK button. You can insert a hyperlink into a field in a table or form. However, the field data type must be designated as Hyperlink. The default settings display a new hyperlink in blue underlined text and a followed hyperlink (one that has been used) in purple underlined text. When you click the label, the hyperlink path is followed to the specified location. The document at the end of the path can be a web page for company headquarters anywhere in the world, another form or report in the current database, or anywhere in between. For example, in the header of an Annual Sales Report, you can insert hyperlink labels that, when activated, open related reports, such as a Quarterly Sales Report for that year. Hyperlink labels in forms or reports must contain a viable path, but the path itself does not need to be displayed on the label. As with hyperlink fields, you can display a label with descriptive text rather than the actual path. When you point to a hyperlink, the mouse pointer changes into a hand pointing upward, signifying that one mouse click activates the hyperlink. Page 132 WWP Learning and Development Ltd

137 EDITING A HYPERLINK You may occasionally have to edit your hyperlinks. Changes in web addresses are common, and any file location changes on your PC or server need to be reflected with an updated hyperlink. You can edit the hyperlink text or replace it with a new location. Using the right mouse button to click in form or datasheet view allows you to select Edit Hyperlink from the shortcut menu. You can then modify the hyperlink accordingly. DELETING A HYPERLINK FIELD If a hyperlink becomes invalid, or is no longer of any use, it can be deleted. As with editing a hyperlink, you cannot simply double-click a hyperlink to select it. You can also delete a hyperlink by selecting it and pressing the [Delete] key. To delete a hyperlink, first open the required table in datasheet view or form in Design view. Use the right mouse button to click on the hyperlink you intend to delete. In the shortcut menu, click on the Hyperlink command. Click on Remove Hyperlink. WWP Learning and Development Ltd Page 133

138 EXPORTING DATABASE OBJECTS TO HTML In Access 2007, you can save a table, query, form, or report, as a Web page using the Export HTML document command. When you save a page in HTML, it displays only the data at the time the file was created. If the data changes, then the data must be exported again in order to update the Web pages. To export to a HTML file, first select the table, query, form, or report you wish to export. Click on the External Data tab. In the Export group, click on the More button. Click on HTML document. In the Export - HTML Document dialog box, use the Browse button to locate and specify the file destination. Specify which export options you want. Click on the OK button. Specify the output options required. Click on the OK button. Choose whether or not to save the export steps and click on the Close button. Page 134 WWP Learning and Development Ltd

139 IMPORTING OR LINKING TO A HTML FILE You can import HTML files into Access tables. Access uses the Import HTML Wizard for you to specify how you intend to import the data into your database. To import or Link to a HTML file, first open he database you wish to import to. Click on the External Data tab. In the Import group, click on the More button. Click on HTML Document. Specify the name and location of the file. Click on the OK button. Click on the option you require for importing the data from: Import the source data into a new table in the current database Append a copy of the records to the table Link to the data source by creating a linked table. Click on the OK button. Use the Import HTML Wizard pages to specify how you want to import the data. After naming the new table, click on the Finish button. If necessary, click to save the Import steps. Click on the Close button. The HTML file is displayed as a table WWP Learning and Development Ltd Page 135

140 USING SHAREPOINT If you have access to a Microsoft Office SharePoint Services site, you can import from, export, or move to, a SharePoint list. A SharePoint Services site is a server application using Web site templates to create, share, and organize, data. To use a SharePoint Services site, you may need access privileges for which you must see your network administrator. To create a table using a SharePoint List, first click on the Create tab. In the Tables group, click on the SharePoint Lists button. Click on the SharePoint list template you want. Enter a SharePoint side address or select an existing one. Enter a name and description. To open the list, place a check in the Open the list when finished check box. Click on the OK button. The SharePoint Wizard will guide you through the process of importing, linking, exporting, and moving data, to and from SharePoint. Since the SharePoint Server is a Web based system, everyone with permission can enter with a simple Web browser. The Server allows you to create several different types of sites using templates. A Team Site is a template for teams to create, share, and organise information. A Document Workspace is a template for users to post information. A Wiki Site is a template where users can add, edit, and link information. Page 136 WWP Learning and Development Ltd

141 EXERCISE - USING ACCESS AND THE INTERNET 1. Open Train33x. 2. Create a field called Link with a Hyperlink data type in the Sales table. 3. View the Sales table and enter into the first record a hyperlink to: 4. Click the hyperlink text to display web page. Close the browser. 5. Edit the hyperlink so that it opens the Abbott Contract Word document (Hint: Right click the data in the table and select the Hyperlink menu). 6. Test the hyperlink to display the Word document. Close Word. 7. Delete the hyperlink. 8. Import the reps.html file. View the new table and close it. 9. Export the Trainer table as a html document. Choose to view the document after export. After viewing the html document, close the Explorer. 10. Close the database. WWP Learning and Development Ltd Page 137

142 APPENDIX B ADVANCED ACCESS SECURITY INTRODUCTION If you need to validate the authenticity of a database, you can package the database in a file and add a digital signature as proof of authentication. Additional security options can be set in the Trust Center which is in Access Options. In this lesson, you will learn how to: Use digital certificates Create digital certificates Use the Trust Center Lock a database Lock database records CREATING A DIGITAL SIGNATURE Once you have constructed your database, you can add an electronic stamp of authentication on the file, a digital signature. Applying a digital signature to a component is known as code-signing. You apply your signature to your database so other certified users will know it is safe to use. Before you can add a digital signature you need to create a digital ID, or digital certificate, which provides an electronic way to prove your identity. To assure a digital signature is authentic, it must have a valid certificate issued by a reputable certification authority and the signing person must be from a trusted publisher such as a trusted Microsoft partner. If you do not need a verified digital certificate you can create on of your own. Such a certificate would be known as a selfsigned certificate. To create a self-signed certificate, click on the Start button. Point to All Programs. Click on Microsoft Office. Click on Microsoft Tools. Click on Digital Certificate for VBA Projects. Enter a name. Click on the OK button. In the Self Cert Success box, click on the OK button. Page 138 WWP Learning and Development Ltd

143 ADDING A DIGITAL SIGNATURE TO A DATABASE If you need to add a digital signature to a document with a macro, you do it using the Visual Basic Editor. Should you open a document containing a signed macro with a problem the macro is disabled by default and the Message Bar is displayed indicating the possible problem. Clicking on Options in the Message Bar enables you to view more information about the problem. For further details, clicking on Show Signature Details allow you to see the certificate and publisher information. If there is a problem with the digital signature, such as date expired, or the document has been altered, the certificate information contains a red X. To sign a database, first open the required database. Click on the Database Tools tab. In the Macro group, click on the Visual Basic button. In the Project window, click on the database. Click on the Tools menu. Click on Digital Signature In the Digital Signature dialog box, click on the Choose button. Select your certificate. Click on the OK button. In the Digital Signature box, click on the OK button. Close the Visual Basic window. DIGITALLY SIGNING AND PACKAGING A DATABASE The Package and Sign command in the Office menu allows you to package, digitally sign, and distribute an Access database. The database is saved in a different format (.accdc). Access signs the package and then stores the digitally signed package where you wish to locate it. Other users can extract the database from the package and work directly in the database. WWP Learning and Development Ltd Page 139

144 To create a signed package, first open the database you want to package and sign. Click on the Office button. In the Office menu, move the mouse cursor to Publish. Click on Package and Sign. Select the digital certificate you want to use. Click on the OK button. Specify the location for the database package. Enter a name for the database package. Click on the Create button. To extract and use a signed database, click on the Office button. Click on Open. In the Files of type: list, select Microsoft Office Access Signed Packages. Locate and specify the file you want. Choose one of the options if you have not chosen to trust the digital certificate. In the Extract dialog box, select the location for the database. Enter a name for the database. Click on the OK button. Page 140 WWP Learning and Development Ltd

145 USING THE TRUST CENTER The Trust Center security system sets strict criteria on database components. The Trust Center is used to set specific security options and to create, or change, trusted locations. To view the Trust Center, click on the Office button. Click on the Access Options button. In the left pane, click on Trust Center. You can choose from the link options to view: privacy practices, Improvement Program, the Windows Security Center. Click on the Trust Center Settings button. You can set, or change, options concerning: Trusted Publishers Trusted Locations Add-ins Macro Settings Message Bar Privacy Options. When completed, click on the OK button. Click on the OK button to leave the Access Options. LOCKING A DATABASE In the Database Tools group is the Make ACCDE button which allows you to lock a file and prevent users from viewing or modifying any VBA code, and from making any changes to reports or forms. Using the ACCDE command changes the file extension from.accdb to.accde and, if the database contains any VBA code, only the compiled code is included in the new file. WWP Learning and Development Ltd Page 141

146 When a.accde file is opened, Access creates and opens a temporary locking file with the extension.ladddb to prevent any conflicts. When the file is closed, the temporary file is automatically deleted. To create a locked database, first open the file you want to lock. Click on the Database Tools tab. In the Database Tools group, click on the Make ACCDE button. In the Save As dialog box, specify the location and name for the file. Click on the Save button. LOCKING DATABASE RECORDS In a multi-user environment, more than one user could attempt to edit the same record at the same time. This can be prevented by using record locking, ensuring only one user at any one time can edit data. You can also prevent conflicts by opening the database in exclusive mode which prevents any other user(s) from accessing the database while you are using it. This is useful for database owners to be able to make changes to the database file. To set record locking, first open the required database. Click on the Office button. Click on the Access Options button. Click on Advanced in the left pane. In the right pane, choose the Shared or Exclusive option as required. Click the Default Record Locking to be one of No locks All records Edited record. Click on the Open databases by using record-level locking check box. Click on the OK button. Page 142 WWP Learning and Development Ltd

ACCESS 2007 ADVANCED

ACCESS 2007 ADVANCED ACCESS 2007 ADVANCED Welcome! Thank you for choosing WWP as your learning and development provider. We hope that your programme today will be a stimulating, informative and rewarding experience. Our highly

More information

Table of Contents COURSE OVERVIEW... 5

Table of Contents COURSE OVERVIEW... 5 Table of Contents COURSE OVERVIEW... 5 DISCUSSION... 5 THE NEW DATABASE FORMAT... 5 COURSE TOPICS... 6 CONVENTIONS USED IN THIS MANUAL... 7 Tip Open a File... 7 LESSON 1: THE NEW INTERFACE... 8 LESSON

More information

Getting started with Ms Access Getting Started. Primary Key Composite Key Foreign Key

Getting started with Ms Access Getting Started. Primary Key Composite Key Foreign Key Getting started with Ms Access 2007 Getting Started Customize Microsoft Office Toolbar The Ribbon Quick Access Toolbar Navigation Tabbed Document Window Viewing Primary Key Composite Key Foreign Key Table

More information

Microsoft Certified Application Specialist Exam Objectives Map

Microsoft Certified Application Specialist Exam Objectives Map Microsoft Certified Application Specialist Exam Objectives Map This document lists all Microsoft Certified Application Specialist exam objectives for (Exam 77-605) and provides references to corresponding

More information

Microsoft Access XP Queries. Student Manual

Microsoft Access XP Queries. Student Manual Microsoft Access XP Queries Student Manual Duplication is prohibited without the written consent of The Abreon Group. Foster Plaza 10 680 Andersen Drive Suite 500 Pittsburgh, PA 15220 412.539.1800 800.338.5185

More information

Access 2016 Essentials Syllabus

Access 2016 Essentials Syllabus Access 2016 Essentials Syllabus Lesson 1 Creating & Managing Databases 1.1 Introduction Lesson content; What is a database? The course folders; The course player; Screen resolution notes; Prerequisites;

More information

Introduction to Microsoft Access 2016

Introduction to Microsoft Access 2016 Introduction to Microsoft Access 2016 A database is a collection of information that is related. Access allows you to manage your information in one database file. Within Access there are four major objects:

More information

Microsoft Access II 1.) Opening a Saved Database Music Click the Options Enable this Content Click OK. *

Microsoft Access II 1.) Opening a Saved Database Music Click the Options Enable this Content Click OK. * Microsoft Access II 1.) Opening a Saved Database Open the Music database saved on your computer s hard drive. *I added more songs and records to the Songs and Artist tables. Click the Options button next

More information

Enforce Referential. dialog box, click to mark the. Enforce Referential. Integrity, Cascade Update Related Fields, and. Cascade Delete Related

Enforce Referential. dialog box, click to mark the. Enforce Referential. Integrity, Cascade Update Related Fields, and. Cascade Delete Related PROCEDURES LESSON 8: MANAGING RELATIONSHIPS BETWEEN TABLES Renaming a Table 1 In the Navigation pane, right-click the table you want to rename 2 On the shortcut menu, click Rename 3 Type the new table

More information

MIS Cases: Decision Making With Application Software, Second Edition. Database Glossary

MIS Cases: Decision Making With Application Software, Second Edition. Database Glossary MIS Cases: Decision Making With Application Software, Second Edition Database Glossary This database glossary is designed to accompany MIS Cases: Decision Making With Application Software, Second Edition,

More information

Microsoft Access 2010

Microsoft Access 2010 Microsoft Access 2010 Chapter 2 Querying a Database Objectives Create queries using Design view Include fields in the design grid Use text and numeric data in criteria Save a query and use the saved query

More information

Englische Access 2016-Trainingsskripte für IT Seminare und EDV Schulungen als Word-Dokument zum Ausdrucken und fürs Intranet

Englische Access 2016-Trainingsskripte für IT Seminare und EDV Schulungen als Word-Dokument zum Ausdrucken und fürs Intranet Englische Access 2016-Trainingsskripte für IT Seminare und EDV Schulungen als Word-Dokument zum Ausdrucken und fürs Intranet 9 Data analyses To analyze data, a tabular preparation of the data or a chart

More information

Creating a Crosstab Query in Design View

Creating a Crosstab Query in Design View Procedures LESSON 31: CREATING CROSSTAB QUERIES Using the Crosstab Query Wizard box, click Crosstab Query Wizard. 5. In the next Crosstab Query the table or query on which you want to base the query. 7.

More information

MS Access Let s begin by looking at the toolbar and menu of Access.

MS Access Let s begin by looking at the toolbar and menu of Access. MS Access 2003 Access is a database program that allows you to store, retrieve, analyze, and print information. Individuals use databases for various purposes. Businesses use databases to manage customer

More information

Access ComprehGnsiwG. Shelley Gaskin, Carolyn McLellan, and. Nancy Graviett. with Microsoft

Access ComprehGnsiwG. Shelley Gaskin, Carolyn McLellan, and. Nancy Graviett. with Microsoft with Microsoft Access 2010 ComprehGnsiwG Shelley Gaskin, Carolyn McLellan, and Nancy Graviett Prentice Hall Boston Columbus Indianapolis New York San Francisco Upper Saddle River Imsterdam Cape Town Dubai

More information

Microsoft Access 2010

Microsoft Access 2010 Microsoft Access 2010 Microsoft Access is database software that provides templates to help you add databases that make it easier to track, report, and share data with others. Although very powerful, the

More information

AVANTUS TRAINING PTE LTD

AVANTUS TRAINING PTE LTD [MSACS13]: Microsoft Access 2013 Length : 3 Days Technology : Microsoft Office 2013 Delivery Method : Instructor-led (Classroom) Course Overview This Microsoft Access 2013 teaches participants how to design

More information

Microsoft Access 2013

Microsoft Access 2013 Microsoft Access 2013 Chapter 2 Querying a Database Objectives Create queries using Design view Include fields in the design grid Use text and numeric data in criteria Save a query and use the saved query

More information

Microsoft Access 2013

Microsoft Access 2013 Microsoft Access 2013 Chapter 2 Querying a Database Objectives Create queries using Design view Include fields in the design grid Use text and numeric data in criteria Save a query and use the saved query

More information

Excel 2007 New Features Table of Contents

Excel 2007 New Features Table of Contents Table of Contents Excel 2007 New Interface... 1 Quick Access Toolbar... 1 Minimizing the Ribbon... 1 The Office Button... 2 Format as Table Filters and Sorting... 2 Table Tools... 4 Filtering Data... 4

More information

Links to Activities ACTIVITY 4.1. Links to Activities Links to Activities

Links to Activities ACTIVITY 4.1. Links to Activities Links to Activities ACCESS SUMMARIZING DATA AND CALCULATING IN FORMS AND REPORTS Section 4 Skills Use functions in a query to calculate statistics Summarize data in a crosstab query Summarize data in a PivotTable Summarize

More information

Access Review. 4. Save the table by clicking the Save icon in the Quick Access Toolbar or by pulling

Access Review. 4. Save the table by clicking the Save icon in the Quick Access Toolbar or by pulling Access Review Relational Databases Different tables can have the same field in common. This feature is used to explicitly specify a relationship between two tables. Values appearing in field A in one table

More information

Microsoft Access 2016 Level 1

Microsoft Access 2016 Level 1 Microsoft Access 2016 Level 1 One Day Course Course Description Most organisations maintain and manage large amounts of information. One of the most efficient and powerful ways of managing data is by using

More information

Microsoft Office Specialist Access 2016

Microsoft Office Specialist Access 2016 77-730 Microsoft Office Specialist Access 201 For coverage of all objectives, please utilize Shelly Cashman Series Office 35 & Access 201 Comprehensive Domain Obj Number Objective text Module Pages: Topic

More information

Complete Quick Reference Summary

Complete Quick Reference Summary Microsoft Access 2010 Complete Quick Reference Summary Microsoft Access 2010 Quick Reference Summary Advanced Filter/Sort, Use AC 153 Advanced button (Home tab Sort & Filter, Advanced Filter/Sort) All

More information

Exploring Microsoft Office Access Chapter 2: Relational Databases and Multi-Table Queries

Exploring Microsoft Office Access Chapter 2: Relational Databases and Multi-Table Queries Exploring Microsoft Office Access 2010 Chapter 2: Relational Databases and Multi-Table Queries 1 Objectives Design data Create tables Understand table relationships Share data with Excel Establish table

More information

Administering a Database System

Administering a Database System Microsoft Access 2010 10 Administering a Database System Objectives You will have mastered the material in this project when you can: Create custom Quick Start fields Create indexes Create a Web database

More information

Creating Reports in Access 2007 Table of Contents GUIDE TO DESIGNING REPORTS... 3 DECIDE HOW TO LAY OUT YOUR REPORT... 3 MAKE A SKETCH OF YOUR

Creating Reports in Access 2007 Table of Contents GUIDE TO DESIGNING REPORTS... 3 DECIDE HOW TO LAY OUT YOUR REPORT... 3 MAKE A SKETCH OF YOUR Creating Reports in Access 2007 Table of Contents GUIDE TO DESIGNING REPORTS... 3 DECIDE HOW TO LAY OUT YOUR REPORT... 3 MAKE A SKETCH OF YOUR REPORT... 3 DECIDE WHICH DATA TO PUT IN EACH REPORT SECTION...

More information

Importing and Exporting Data

Importing and Exporting Data 14 Importing and Exporting Data SKILL SUMMARY Skills Exam Objective Objective Number Importing Data Import data into tables. Append records from external data. Import tables from other databases. Create

More information

Creating a Spreadsheet by Using Excel

Creating a Spreadsheet by Using Excel The Excel window...40 Viewing worksheets...41 Entering data...41 Change the cell data format...42 Select cells...42 Move or copy cells...43 Delete or clear cells...43 Enter a series...44 Find or replace

More information

Tutorial 2. Building a Database and Defining Table Relationships

Tutorial 2. Building a Database and Defining Table Relationships Tutorial 2 Building a Database and Defining Table Relationships Microsoft Access 2010 Objectives Learn the guidelines for designing databases and setting field properties Modify the format of a field in

More information

Using Microsoft Access

Using Microsoft Access Using Microsoft Access USING MICROSOFT ACCESS 1 Interfaces 2 Basic Macros 2 Exercise 1. Creating a Test Macro 2 Exercise 2. Creating a Macro with Multiple Steps 3 Exercise 3. Using Sub Macros 5 Expressions

More information

Access Intermediate

Access Intermediate Access 2013 - Intermediate 103-134 Advanced Queries Quick Links Overview Pages AC124 AC125 Selecting Fields Pages AC125 AC128 AC129 AC131 AC238 Sorting Results Pages AC131 AC136 Specifying Criteria Pages

More information

MODULE 5 DATABASES. Content

MODULE 5 DATABASES. Content MODULE 5 DATABASES Module Goals Module 5 - Databases, requires candidates to understand some of the basic concepts of databases demonstrate the ability to use a database on a personal computer. Candidates

More information

AVANTUS TRAINING PTE LTD

AVANTUS TRAINING PTE LTD [MSACS10]: Microsoft Access 2010 Length Delivery Method : 3 Days : Instructor-led (Classroom) Course Overview Microsoft Access 2010 teaches participants how to design data tables, select appropriate data

More information

Objective 1: Familiarize yourself with basic database terms and definitions. Objective 2: Familiarize yourself with the Access environment.

Objective 1: Familiarize yourself with basic database terms and definitions. Objective 2: Familiarize yourself with the Access environment. Beginning Access 2007 Objective 1: Familiarize yourself with basic database terms and definitions. What is a Database? A Database is simply defined as a collection of related groups of information. Things

More information

Microsoft Access 2007 Module 1

Microsoft Access 2007 Module 1 Microsoft Access 007 Module http://citt.hccfl.edu Microsoft Access 007: Module August 007 007 Hillsborough Community College - CITT Faculty Professional Development Hillsborough Community College - CITT

More information

Open. Select the database and click. Print. Set printing options using the dropdown menus, then click the

Open. Select the database and click. Print. Set printing options using the dropdown menus, then click the The Original Quick Reference Guides Microsoft Access 2010 Access is a tool for creating and managing databases collections of related records structured in an easily accessible format such as a table,

More information

INTRODUCTION ACCESS 2010

INTRODUCTION ACCESS 2010 INTRODUCTION ACCESS 2010 Overview of Ms. Access 2010 Microsoft Access is a computer application used to create and manage databases. Access Databases can store any type of information: numbers, text, and

More information

Microsoft Office Access 2007: Intermediate Course 01 Relational Databases

Microsoft Office Access 2007: Intermediate Course 01 Relational Databases Microsoft Office Access 2007: Intermediate Course 01 Relational Databases Slide 1 Relational Databases Course objectives Normalize tables Set relationships between tables Implement referential integrity

More information

Microsoft Access 2013

Microsoft Access 2013 Microsoft Access 2013 Chapter 1 Databases and Database Objects: An Introduction Objectives Describe the features of the Access window Create a database Create tables in Datasheet and Design views Add records

More information

Instructions for Using the Databases

Instructions for Using the Databases Appendix D Instructions for Using the Databases Two sets of databases have been created for you if you choose to use the Documenting Our Work forms. One set is in Access and one set is in Excel. They are

More information

Microsoft Access 2010

Microsoft Access 2010 Microsoft Access 2010 Chapter 1 Databases and Database Objects: An Introduction Objectives Design a database to satisfy a collection of requirements Describe the features of the Access window Create a

More information

Module 5. Databases. Astro Computer Training. Page 1

Module 5. Databases. Astro Computer Training. Page 1 Module 5 Databases Astro Computer Training Page 1 1. Database Terminologies What is a Database? A database is a collection of data related to a particular topic organised and stored for easy retrieval.

More information

Index. B backing up 76 7

Index. B backing up 76 7 A Access, other DBMSs and 9 Action queries 121, 125 defined 125 address book 16, 34 age calculations 60 answer table 36 editing data in 147 8 field names 294 multi-table queries 294 queries and 155 queries

More information

ACCESS 2007 FOUNDATION

ACCESS 2007 FOUNDATION ACCESS 2007 FOUNDATION WWP Learning and Development Ltd Page i STUDENT EDITION LESSON 1 - EXPLORING ACCESS... 1 Introduction... 1 Opening An Existing Database... 4 Converting Existing Databases... 5 The

More information

Excel Tables & PivotTables

Excel Tables & PivotTables Excel Tables & PivotTables A PivotTable is a tool that is used to summarize and reorganize data from an Excel spreadsheet. PivotTables are very useful where there is a lot of data that to analyze. PivotTables

More information

MICRSOFT OFFICE PACKAGE COURSE OUTLINES

MICRSOFT OFFICE PACKAGE COURSE OUTLINES MICRSOFT OFFICE PACKAGE COURSE OUTLINES Document Created by: Sivashankar Santhanam Training Course Outline- 3 Levels for Access 2013 Beginner Level -Access: In this course, students will learn how to use

More information

Microsoft Access 2013/2016 Course Outlines (version differences will be noted in the outline).

Microsoft Access 2013/2016 Course Outlines (version differences will be noted in the outline). Microsoft Access 2013/2016 Course Outlines (version differences will be noted in the outline). Microsoft Access 2013/2016 Level I Course Content Description: This Instructor-led Training course covers

More information

BusinessObjects Frequently Asked Questions

BusinessObjects Frequently Asked Questions BusinessObjects Frequently Asked Questions Contents Is there a quick way of printing together several reports from the same document?... 2 Is there a way of controlling the text wrap of a cell?... 2 How

More information

SEE GRADING CRITERIA AT THE BOTTOM. Database Tables Lookup Wizard Relationships Forms Queries Reports

SEE GRADING CRITERIA AT THE BOTTOM. Database Tables Lookup Wizard Relationships Forms Queries Reports Microsoft Office 2007 PDF Picture Tutorial Series Databases Tables, Forms, Queries, Lookup Wizard, Relationships August 2010 by Floyd Jay Winters and Julie Manchester winterf@scf.edu SEE GRADING CRITERIA

More information

Access Intermediate

Access Intermediate Access 2010 - Intermediate 103-134 Advanced Queries Quick Links Overview Pages AC116 AC117 Selecting Fields Pages AC118 AC119 AC122 Sorting Results Pages AC125 AC126 Specifying Criteria Pages AC132 AC134

More information

Advanced Queries: Moving Beyond the Select Query Instructor: Edwin V. Bonilla

Advanced Queries: Moving Beyond the Select Query Instructor: Edwin V. Bonilla Advanced Queries: Moving Beyond the Select Query Instructor: Edwin V. Bonilla Based on slides by Robert Grauer, Keith Mast, Mary Anne Poatsy COMP1000 Pearson Education 2011 or UNSW, CRICOS Provider No:

More information

Using Microsoft Access

Using Microsoft Access Using Microsoft Access USING MICROSOFT ACCESS 1 Forms & Reports 2 Forms 2 Using Auto Forms 2 Exercise 1. Creating a Datasheet Auto Form 3 Exercise 2. Creating a Tabular Auto Form 4 Exercise 3. Creating

More information

Database Tables Lookup Wizard Relationships Forms Subforms Queries Reports

Database Tables Lookup Wizard Relationships Forms Subforms Queries Reports Version 07/11/09 Microsoft Office 2007 PDF Picture Tutorial Series Databases Tables, Forms, Subforms, and the Lookup Wizard May 2009 by Floyd Jay Winters and Julie Manchester winterf@mccfl.edu Database

More information

eschoolplus+ Cognos Query Studio Training Guide Version 2.4

eschoolplus+ Cognos Query Studio Training Guide Version 2.4 + Training Guide Version 2.4 May 2015 Arkansas Public School Computer Network This page was intentionally left blank Page 2 of 68 Table of Contents... 5 Accessing... 5 Working in Query Studio... 8 Query

More information

Excel Level 1

Excel Level 1 Excel 2016 - Level 1 Tell Me Assistant The Tell Me Assistant, which is new to all Office 2016 applications, allows users to search words, or phrases, about what they want to do in Excel. The Tell Me Assistant

More information

Word Module 5: Creating and Formatting Tables

Word Module 5: Creating and Formatting Tables Illustrated Microsoft Office 365 and Office 2016 Intermediate 1st Edition Beskeen Test Bank Full Download: http://testbanklive.com/download/illustrated-microsoft-office-365-and-office-2016-intermediate-1st-edition-beskee

More information

Les s on Objectives. Student Files Us ed. Student Files Crea ted

Les s on Objectives. Student Files Us ed. Student Files Crea ted Lesson 10 - Pivot Tables 103 Lesson 10 P ivot T ables Les s on Topics Creating a Pivot Table Exercise: Creating a Balance Summary Formatting a Pivot Table Creating a Calculated Field Les s on Objectives

More information

ICDL & OOo BASE. Module Five. Databases

ICDL & OOo BASE. Module Five. Databases ICDL & OOo BASE Module Five Databases BASE Module Goals taken from the Module 5 ICDL Syllabus Module 5 Database requires the candidate to understand some of the main concepts of databases and demonstrates

More information

Copyright 2009 Labyrinth Learning Not for Sale or Classroom Use LESSON 1. Designing a Relational Database

Copyright 2009 Labyrinth Learning Not for Sale or Classroom Use LESSON 1. Designing a Relational Database LESSON 1 By now, you should have a good understanding of the basic features of a database. As you move forward in your study of Access, it is important to get a better idea of what makes Access a relational

More information

CHAPTER 6 SUMMARY. Objective 1: Identify Good Database Design

CHAPTER 6 SUMMARY. Objective 1: Identify Good Database Design Objective 1: Identify Good Database Design CHAPTER 6 SUMMARY A database is an organized collection of data facts about people, events, things, or ideas related to a specific topic or purpose. Information

More information

Excel Basic 1 GETTING ACQUAINTED WITH THE ENVIRONMENT 2 INTEGRATION WITH OFFICE EDITING FILES 4 EDITING A WORKBOOK. 1.

Excel Basic 1 GETTING ACQUAINTED WITH THE ENVIRONMENT 2 INTEGRATION WITH OFFICE EDITING FILES 4 EDITING A WORKBOOK. 1. Excel Basic 1 GETTING ACQUAINTED WITH THE ENVIRONMENT 1.1 Introduction 1.2 A spreadsheet 1.3 Starting up Excel 1.4 The start screen 1.5 The interface 1.5.1 A worksheet or workbook 1.5.2 The title bar 1.5.3

More information

Office Applications II Lesson Objectives

Office Applications II Lesson Objectives Office Applications II Lesson Unit 1: MICROSOFT EXCEL SPREADSHEETS BASICS What is a Spreadsheet and What Are Its Uses? Define spreadsheets Define the Microsoft Excel application List business, consumer,

More information

Microsoft How to Series

Microsoft How to Series Microsoft How to Series Getting Started with EXCEL 2007 A B C D E F Tabs Introduction to the Excel 2007 Interface The Excel 2007 Interface is comprised of several elements, with four main parts: Office

More information

Microsoft Excel 2010 Basic

Microsoft Excel 2010 Basic Microsoft Excel 2010 Basic Introduction to MS Excel 2010 Microsoft Excel 2010 is a spreadsheet software in the new Microsoft 2010 Office Suite. Excel allows you to store, manipulate and analyze data in

More information

Chapter11 practice file folder. For more information, see Download the practice files in this book s Introduction.

Chapter11 practice file folder. For more information, see Download the practice files in this book s Introduction. Make databases user friendly 11 IN THIS CHAPTER, YOU WILL LEARN HOW TO Design navigation forms. Create custom categories. Control which features are available. A Microsoft Access 2013 database can be a

More information

Module 4: Creating Content Lesson 5: Creating Visualizations Try Now!

Module 4: Creating Content Lesson 5: Creating Visualizations Try Now! Module 4: Creating Content Lesson 5: Creating Visualizations Try Now! In this Try Now! exercise, you will be creating a visualization in your Sales domain, based on the data you uploaded from your Microsoft

More information

Sage 50 U.S. Edition Intelligence Reporting Getting Started Guide

Sage 50 U.S. Edition Intelligence Reporting Getting Started Guide Sage Intelligence Reporting Sage 50 U.S. Edition Intelligence Reporting Getting Started Guide Table of Contents Introduction... 2 System requirements... 3 How it works... 4 Getting started guide... 5 Running

More information

PowerPoint Presentation to Accompany GO! All In One. Chapter 13

PowerPoint Presentation to Accompany GO! All In One. Chapter 13 PowerPoint Presentation to Accompany GO! Chapter 13 Create, Query, and Sort an Access Database; Create Forms and Reports 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Objectives Identify Good

More information

Using Microsoft Excel

Using Microsoft Excel Using Microsoft Excel Table of Contents The Excel Window... 2 The Formula Bar... 3 Workbook View Buttons... 3 Moving in a Spreadsheet... 3 Entering Data... 3 Creating and Renaming Worksheets... 4 Opening

More information

Word 2016 Advanced. North American Edition SAMPLE

Word 2016 Advanced. North American Edition SAMPLE Word 2016 Advanced Word 2016 Advanced North American Edition WORD 2016 ADVANCED Page 2 2015 Cheltenham Group Pty. Ltd. All trademarks acknowledged. E&OE. No part of this document may be copied without

More information

Contents. Creating Forms

Contents. Creating Forms Access 2007 Forms Contents Creating Forms... 3 Creating a new form 3 Design view and Form view 5 Creating a user-defined form 5 Changing the look of your form... 6 Layout View 6 Design View 6 Moving and

More information

Access Macros & Advanced Topics

Access Macros & Advanced Topics Access Macros & Advanced Topics Technical Support Services Office of Information Technology, West Virginia University OIT Help Desk 293-4444 x 1 http://oit.wvu.edu/support/training/classmat/db/ Instructor:

More information

Excel 2013 PivotTables and PivotCharts

Excel 2013 PivotTables and PivotCharts Excel 2013 PivotTables and PivotCharts PivotTables... 1 PivotTable Wizard... 1 Creating a PivotTable... 2 Groups... 2 Rows Group... 3 Values Group... 3 Columns Group... 4 Filters Group... 5 Field Settings...

More information

Introduction to Microsoft Excel 2007

Introduction to Microsoft Excel 2007 Introduction to Microsoft Excel 2007 Microsoft Excel is a very powerful tool for you to use for numeric computations and analysis. Excel can also function as a simple database but that is another class.

More information

Microsoft Access 2010

Microsoft Access 2010 www.jwalkonline.org/main michael@jwalkonline.org @MichaelJWalk Microsoft Access 2010 Part 3 Michael J. Walk It's about control: use advanced features of Access to control data entry, automate processes,

More information

TECHNOLOGY COMPETENCY ASSESSMENT MODULE Microsoft Access

TECHNOLOGY COMPETENCY ASSESSMENT MODULE Microsoft Access TECHNOLOGY COMPETENCY ASSESSMENT MODULE Microsoft Access This module was developed to assist students in passing the SkillCheck Incorporated Access 2003 Technology Competency Assessment. It was last updated

More information

1.8.1 Research various database careers SE: 335

1.8.1 Research various database careers SE: 335 AR Advanced Database Framework (492140) Correlated to Benchmark Series: Microsoft Access 2010 Part 1 Unit 1: Introduction to Relational Databases and Database Careers 1.1 Define terminology 1.1.1 Prepare

More information

Using Microsoft Office 2003 Advanced Access Handout INFORMATION TECHNOLOGY SERVICES California State University, Los Angeles Version 1.

Using Microsoft Office 2003 Advanced Access Handout INFORMATION TECHNOLOGY SERVICES California State University, Los Angeles Version 1. Using Microsoft Office 2003 Advanced Access Handout INFORMATION TECHNOLOGY SERVICES California State University, Los Angeles Version 1.1 Fall 2005 Contents Downloading a Data File... 2 Creating a Macro...

More information

Preview New Features of Office 2007 Programs

Preview New Features of Office 2007 Programs Preview New Features of Office 2007 Programs With new software, you expect some increased functionality. This lesson is a subjective review of new features that the trainers of Software Training Services

More information

SE: 4, 6, 31 (Knowledge Check), 60, (Knowledge Check) 1.2 Explain the purpose of a relational Explain how a database is

SE: 4, 6, 31 (Knowledge Check), 60, (Knowledge Check) 1.2 Explain the purpose of a relational Explain how a database is AR Advanced Database Framework (492140) Correlated to Marquee Series: Microsoft Access 2010 Unit 1: Introduction to Relational Databases and Database Careers 1.1 Define terminology 1.1.1 Prepare a list

More information

GO! with Microsoft Access 2016 Comprehensive

GO! with Microsoft Access 2016 Comprehensive GO! with Microsoft Access 2016 Comprehensive First Edition Chapter 1 Getting Started with Microsoft Access 2016 Learning Objectives Identify Good Database Design Create a Table and Define Fields in a Blank

More information

MICROSOFT ACCESS VERSION 2010 FOUNDATION

MICROSOFT ACCESS VERSION 2010 FOUNDATION MICROSOFT ACCESS VERSION 2010 FOUNDATION WWP Learning and Development Page i Contents CONTENTS CONTENTS... II LESSON 1 EXPLORING ACCESS... 1 DATABASES OVERVIEW... 2 OPENING AN EXISTING DATABASE... 4 CONVERTING

More information

Intermediate Microsoft Access 2010

Intermediate Microsoft Access 2010 OBJECTIVES Develop Field Properties Import Data from an Excel Spreadsheet & MS Access database Create Relationships Create a Form with a Subform Create Action Queries Create Command Buttons Create a Switchboard

More information

Skills Exam Objective Objective Number

Skills Exam Objective Objective Number Overview 1 LESSON SKILL MATRIX Skills Exam Objective Objective Number Starting Excel Create a workbook. 1.1.1 Working in the Excel Window Customize the Quick Access Toolbar. 1.4.3 Changing Workbook and

More information

Access. Basics PRESENTED BY THE TECHNOLOGY TRAINERS OF THE MONROE COUNTY LIBRARY SYSTEM

Access. Basics PRESENTED BY THE TECHNOLOGY TRAINERS OF THE MONROE COUNTY LIBRARY SYSTEM Access 2010 Basics PRESENTED BY THE TECHNOLOGY TRAINERS OF THE MONROE COUNTY LIBRARY SYSTEM EMAIL: TRAININGLAB@MONROE.LIB.MI.US MONROE COUNTY LIBRARY SYSTEM 734-241-5770 840 SOUTH ROESSLER STREET MONROE,

More information

Excel Main Screen. Fundamental Concepts. General Keyboard Shortcuts Open a workbook Create New Save Preview and Print Close a Workbook

Excel Main Screen. Fundamental Concepts. General Keyboard Shortcuts Open a workbook Create New Save Preview and Print Close a Workbook Excel 2016 Main Screen Fundamental Concepts General Keyboard Shortcuts Open a workbook Create New Save Preview and Print Close a Ctrl + O Ctrl + N Ctrl + S Ctrl + P Ctrl + W Help Run Spell Check Calculate

More information

Chapter 4: Single Table Form Lab

Chapter 4: Single Table Form Lab Chapter 4: Single Table Form Lab Learning Objectives This chapter provides practice with creating forms for individual tables in Access 2003. After this chapter, you should have acquired the knowledge

More information

INTRODUCTION... 1 UNDERSTANDING CELLS... 2 CELL CONTENT... 4

INTRODUCTION... 1 UNDERSTANDING CELLS... 2 CELL CONTENT... 4 Introduction to Microsoft Excel 2016 INTRODUCTION... 1 The Excel 2016 Environment... 1 Worksheet Views... 2 UNDERSTANDING CELLS... 2 Select a Cell Range... 3 CELL CONTENT... 4 Enter and Edit Data... 4

More information

Microsoft. Access Microsoft Office Specialist 2010 Series EXAM COURSEWARE Achieve more. For Evaluation Only

Microsoft. Access Microsoft Office Specialist 2010 Series EXAM COURSEWARE Achieve more. For Evaluation Only Microsoft Access 2010 Microsoft Office Specialist 2010 Series COURSEWARE 3245 1 EXAM 77 885 Achieve more Microsoft Office Specialist 2010 Series Microsoft Access 2010 Core Certification Lesson 1: Exploring

More information

Productivity Tools Objectives

Productivity Tools Objectives Word 2003 Understand Microsoft Office Word 2003 Launch Microsoft Office Word 2003 Open Documents Understand The Working Screen Experiment With The Working Screen Navigate Documents Close Documents And

More information

Simple Invoicing Desktop Database with MS Access 2013/2016. David W. Gerbing School of Business Administration Portland State University

Simple Invoicing Desktop Database with MS Access 2013/2016. David W. Gerbing School of Business Administration Portland State University Simple Invoicing Desktop Database with MS Access 2013/2016 David W. Gerbing School of Business Administration Portland State University July 7, 2018 CONTENTS 1 Contents 1 Create a New Database 1 2 Customer

More information

Query Studio Training Guide Cognos 8 February 2010 DRAFT. Arkansas Public School Computer Network 101 East Capitol, Suite 101 Little Rock, AR 72201

Query Studio Training Guide Cognos 8 February 2010 DRAFT. Arkansas Public School Computer Network 101 East Capitol, Suite 101 Little Rock, AR 72201 Query Studio Training Guide Cognos 8 February 2010 DRAFT Arkansas Public School Computer Network 101 East Capitol, Suite 101 Little Rock, AR 72201 2 Table of Contents Accessing Cognos Query Studio... 5

More information

EVALUATION COPY. Unauthorized Reproduction or Distribution Prohibited

EVALUATION COPY. Unauthorized Reproduction or Distribution Prohibited ADVANCED MICROSOFT ACCESS 2016 Advanced Microsoft Access 2016 (ACC2016.2 version 1.0.1) Copyright Information Copyright 2016 Webucator. All rights reserved. The Author Tracy Berry Tracy has been a senior

More information

Microsoft Excel 2013/2016 Pivot Tables

Microsoft Excel 2013/2016 Pivot Tables Microsoft Excel 2013/2016 Pivot Tables Creating PivotTables PivotTables are powerful data analysis tools. They let you summarize data in various ways and instantly change the view you use. A PivotTable

More information

Skills Exam Objective Objective Number. Creating crosstab queries Create a crosstab query

Skills Exam Objective Objective Number. Creating crosstab queries Create a crosstab query 12 Advanced Queries SKILL SUMMARY Skills Exam Objective Objective Number Creating crosstab queries Create a crosstab query. 3.1.2 Creating a subquery Add fields. Remove fields. Group data by using comparison

More information

Discovering Computers & Microsoft Office Office 2010 and Windows 7: Essential Concepts and Skills

Discovering Computers & Microsoft Office Office 2010 and Windows 7: Essential Concepts and Skills Discovering Computers & Microsoft Office 2010 Office 2010 and Windows 7: Essential Concepts and Skills Objectives Perform basic mouse operations Start Windows and log on to the computer Identify the objects

More information

Excel Tables and Pivot Tables

Excel Tables and Pivot Tables A) Why use a table in the first place a. Easy to filter and sort if you only sort or filter by one item b. Automatically fills formulas down c. Can easily add a totals row d. Easy formatting with preformatted

More information

Microsoft Excel 2016 LEVEL 3

Microsoft Excel 2016 LEVEL 3 TECH TUTOR ONE-ON-ONE COMPUTER HELP COMPUTER CLASSES Microsoft Excel 2016 LEVEL 3 kcls.org/techtutor Microsoft Excel 2016 Level 3 Manual Rev 11/2017 instruction@kcls.org Microsoft Excel 2016 Level 3 Welcome

More information