ECDL Module 5 2000

download ECDL Module 5 2000

of 48

Transcript of ECDL Module 5 2000

  • 8/6/2019 ECDL Module 5 2000

    1/48

    MODULE 5

    DATABASES

    Module GoalsModule 5 - Databases, requires candidates to understand some of the basic concepts of databasesdemonstrate the ability to use a database on a personal computer. Candidates acquire the skill tocreate and modify tables, queries, forms and reports and prepare printed outputs. They will also beable to relate tables and will develop competency in retrieving and manipulating information fromexisting databases using the query and sort tools.

    Content

    5.1 Using the Application..................................................................................15.1.1 Database Concepts.................................................................................................................1

    Fields.................................................................................................................................1 Data Type..........................................................................................................................1 Field Properties .................................................................................................................1 Tables................................................................................................................................1 Forms ................................................................................................................................1 Queries..............................................................................................................................1 Reports..............................................................................................................................2 Primary Key.......................................................................................................................2 Index..................................................................................................................................2 Relating Tables..................................................................................................................2 Relationship Rules ............................................................................................................2

    5.1.2 First Steps with Databases......................................................................................................2 Open a Database Application............................................................................................2 Open an Existing Database when Access is Run.............................................................4 Open an Existing Database...............................................................................................4 Create a New Database....................................................................................................4 Save a Database onto a Hard Disk or Diskette.................................................................4 Close the Database...........................................................................................................5 Use Help Functions...........................................................................................................5

    5.1.3 Adjust Basic Settings...............................................................................................................5 Change Viewing Modes ....................................................................................................5 Display / Hide Toolbars .....................................................................................................6

    5.2 Tables........................................................................................................... 65.2.1 Main Operations......................................................................................................................6

    Design and Plan a Database.............................................................................................6

    Create a Table...................................................................................................................6 Field Name ........................................................................................................................7 Data Type..........................................................................................................................7 Description.........................................................................................................................7 Field Properties .................................................................................................................7 Exercise 5.1.......................................................................................................................8 Enter Data into a Table .....................................................................................................8 Exercise 5.2.......................................................................................................................8 Modify Data .......................................................................................................................8 Delete Data in a Table.......................................................................................................9 Add Records to the Database ...........................................................................................9

    Delete Records in a Database ..........................................................................................9

    Navigate throughout a Table.............................................................................................9 Delete a Table .................................................................................................................10

    Module 5 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    2/48

    Close a Table ..................................................................................................................105.2.2 Define Keys ...........................................................................................................................10

    Define a Primary Key ......................................................................................................10 Assign a Field a Primary Key..........................................................................................10 Set up an Index ...............................................................................................................10

    5.2.3 Table Design / Layout............................................................................................................11 Field Format Attributes....................................................................................................11 Modify Field Size .............................................................................................................11 Modify Number Format....................................................................................................11 Modify Date Format.........................................................................................................11 Consequence of Changing Field Size Attributes.............................................................12 Validation Rule ................................................................................................................12 Move a Column within a Table........................................................................................12 Change Column Widths ..................................................................................................12 Sort a Table.....................................................................................................................13 Exercise 5.3.....................................................................................................................13

    5.2.4 Table Relationships...............................................................................................................14 One-To-One Relationship ...............................................................................................14 One-To-Many Relationships............................................................................................15 Delete a Relationship ......................................................................................................16 Relationship Rules ..........................................................................................................16

    5.3 Forms ......................................................................................................... 165.3.1 Working with Forms...............................................................................................................16

    Open a Form ...................................................................................................................16 Create a Form .................................................................................................................17 Create a Form using the AutoForm Facility ....................................................................19 Enter Data into Database using a Form..........................................................................19 Modify Data in a Database using a Form........................................................................19 Delete Records using a Form..........................................................................................19 Form Navigation..............................................................................................................19 Exercise 5.4.....................................................................................................................205.3.2 Modify Form Layout...............................................................................................................20 Format Text .....................................................................................................................21 Change Background Colours in a Form Layout..............................................................21 Import an Image or Graphic into a Form.........................................................................21 Add a Header to a Form..................................................................................................22 Add a Footer to a Form ...................................................................................................23 Change Arrangement of Objects within a Form..............................................................23 Delete a Form..................................................................................................................23 Save and Close a Form...................................................................................................23 Exercise 5.5.....................................................................................................................23

    5.4 Retrieving Information..............................................................................245.4.1 Main Operations....................................................................................................................24 Find a Record..................................................................................................................24

    Apply a Filter....................................................................................................................24 Remove a Filter ...............................................................................................................24 Filter by Form ..................................................................................................................24 Remove Filter by Form....................................................................................................25

    5.4.2 Queries..................................................................................................................................25 Create a Simple Query....................................................................................................25 Save a Query...................................................................................................................26 Run a Query ....................................................................................................................27 Delete a Query ................................................................................................................27 Create a Query with Multiple Criteria ..............................................................................27

    Using AND and OR to Affect Query Results ...................................................................28

    Find Duplicates Query.....................................................................................................28 Exercise 5.6.....................................................................................................................29

    Module 5 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    3/48

    Add Fields to a Query......................................................................................................29 Remove Fields from a Query ..........................................................................................29 Hide Fields in a Query.....................................................................................................30

    5.4.3 Sort Records..........................................................................................................................30 Sort Data based on a Query............................................................................................30 Sort Data based on Common Logical Operators ............................................................30 Sort a Table.....................................................................................................................31 Sort a Form......................................................................................................................31 Exercise 5.7.....................................................................................................................31

    5.5 Reports....................................................................................................... 325.5.1 Working with Reports ............................................................................................................32

    Create a Report...............................................................................................................32 Modify a Report ...............................................................................................................35 Align Fields and Format Text in Header and Detail Sections .........................................35 Delete a Control...............................................................................................................35 Create and Customise Headers and Footers..................................................................35 Group Data in Reports using the Wizard ........................................................................36 Group Data in a Report ...................................................................................................37 Delete a Report ...............................................................................................................37 Exercise 5.8.....................................................................................................................38 Exercise 5.9.....................................................................................................................38

    5.6 Prepare Outputs ........................................................................................ 385.6.1 Prepare to Print .....................................................................................................................38

    Preview............................................................................................................................38 Change Report Orientation .............................................................................................38 Change Paper Size .........................................................................................................38 Print Table Options..........................................................................................................39 Print from Form................................................................................................................39 Print Result of a Query ....................................................................................................39 Print a Report ..................................................................................................................39

    5.7 Extra Exercises.......................................................................................... 40Disclaimer:Please note that all assessments in this module of the workbook are designed solely for practice ofthe skills explained in this module. They are not ECDL certification test items and should not beconstrued as such.

    Module 5 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    4/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    5 DATABASE

    5.1 USING THE APPLICATION

    5.1.1 Database Concepts

    An Access database is a collection of data related to a particular topic / purpose, e.g. customerdata. Information in a database is organised into Fields such as customer name. A group ofrelated fields, such as all the information on a particular customer, is called a Record. A collectionof related records is called a Table. A database, specifically a relational database, is a collection ofone or more related tables that can share information.

    Fields

    Fields within a database have associated properties and data types.

    Data Type

    Data types are attributes that determine what kind of data a field can have. Data types are selectedfrom a drop-down list and include:

    Text - which includes text or a combination of text and numbers that do not require calculations.This data type can be up to 255 characters.

    Memo includes lengthy text or a combination of text and numbers.

    Number this data type consists of numeric data to be used in calculations.

    Date/Time for date and time values.

    Currency for currency values.

    AutoNumber this is a unique sequential number that Access assigns to each new record; itcannot be edited.

    Yes/No for fields that will contain only one of two values Yes or No.Hyperlinks stores hyperlink addresses.

    Lookup Wizard - creates a field that displays either a Lookup List or a Value List, which makesdata entry simpler. A Lookup list displays values looked up from an existing table or query while aValue list displays a fixed set of values that are entered when the field is created.

    Field Properties

    For each data type, field properties can be set. These determine the format, size and othercharacteristics of the data that affect its appearance and accuracy.

    There are four main components to an Access database that we will become familiar with, i.e. Tables,Forms, Queries and Reports.

    Tables

    Tables are the basic storage structures where all data is stored in columns and rows.

    Forms

    Forms are created from tables and display either the entire table or selected fields on a single page.Thus in a form each record is viewed on a separate page.

    Queries

    Queries are used to search for specific data contained in the table and then present the selected

    fields and records in a table format.

    Module 5 Page 1 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    5/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Reports

    Reports are used to present data from a table or query on paper for printing.

    Primary Key

    The power of a database system comes from its ability to quickly find and bring together informationstored in separate tables. In order to do this, each table should include a field that uniquely identifieseach record stored in the table. This information is called the primary key of the table. Once youdesignate a primary key for a table, to ensure uniqueness, Microsoft Access will prevent any duplicatevalues from being entered in the primary key fields.

    Index

    An index can refer to the ordering and the uniqueness of values. When linking tables, indexes areused to ensure links work correctly. Linking tables is beyond the scope of this module. They helpspeed up queries which will be discussed later in this module but slow down data entry as indexesneed to be updated each time data is entered. Indexes are set when designing the table.

    Relating Tables

    When using Access a number of tables, such as Customers, Products, Orders, Employees, etc. areused. A relationship between these tables must be established. Once tables are linked, queries,reports and forms can be created to display or print information that is spread across multiple tables.

    Relationship Rules

    Unique field: It is necessary to have one field in every table that can uniquely identify each record.This field is called the primary key. It is usually some kind of identification number, as they will notrepeat, e.g. RSI number, as no two people will have the same RSI number. Fields like name andsurname are not suitable as primary keys because people in a database may have the same name.

    Fields functionally dependent: Each field in the record should relate to the subject of the record. Ifnot, it is redundant and belongs in another table.

    Ensure each field is independent: It should be possible to alter any one field in a record withoutaffecting any of the others.

    Ensure fields do not contain calculated or derived data: For example, only hold gross pay anddeductions on a persons salary record as net pay can be calculated when required.

    Data in its smallest logical part: Break information into their smallest parts so that specific queriescan be generated, e.g. separate County Galway into a prefix field (County) and a county field(Galway).

    5.1.2 First Steps with Databases

    Open a Database Application

    Microsoft Access can be started in several different ways depending on the set up of your personalcomputer. The Start, Programs menu will contain a Microsoft Access option. There may be ashortcut to Microsoft Access on your Desktop or the Microsoft Office Toolbarwill have an Accessicon.

    AccessShortcut

    MS OfficeToolbar

    Module 5 Page 2 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    6/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    When Access starts, the user is requested to:

    Create a Blank Database

    Access Database Wizards

    Open an existing Database

    Click on the radio button beside Open an existing file and select the database file to open oralternatively:

    Click on the radio button beside Blank Access Database.

    Click on OK and the File New Database window will be displayed.

    Type in a suitable name for the database and save it in a suitable location. (In an ECDL test youmay be asked to save the file on a floppy disk).

    Click on Create.

    When creating a database, a name is assigned to it from the outset. Once the file is created, the usercan then create the tables that contain the data.

    The Database window opens displaying the new empty database with the Create Table optionsdisplayed:

    Menu BarDatabaseToolbar

    DatabaseWindow

    The Database window is where all the elements of the database come together. A database mayhave many tables, queries, forms, reports, macros and modules and it is the Database window thatorganises these components into specific sections. By clicking on the Table tab at the top left of thewindow, all the tables in the database will be displayed.

    Module 5 Page 3 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    7/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Open an Existing Database when Access is Run

    When Microsoft Access is launched, you areimmediately presented with the Microsoft Accessscreen with a number of options as outlined above.

    Click on the radio button Open an Existing

    Database.

    Select the database to be opened from the listavailable.

    Click on Open.

    Open an Existing Database

    The File, Open command can also be used to openan existing database. Another alternative is to usethe Open file icon from the toolbar.

    Create a New Database

    When Access is started, the user is requested to:

    Create a Blank Database, Access Database Wizards or Open an Existing Database.

    Click on the radio button beside Blank Access Database.

    Click on OK and the File New Database window will be displayed.

    Type in a suitable name for the database and save it in a suitable location. (In an ECDL test youmay be asked to save the file on a floppy disk).

    Click on Create.

    When creating a database, a name is assigned to it from the outset. Once the file is created, the usercan then create the tables that contain the data.

    Save a Database onto a Hard Disk orDiskette

    With the active database on the screen, click on theFile menu and the Export option.

    Select the database into which to export the tableand click on Save All.In the Save In text box, click on the drop-downarrow and select the required drive and folder. Thiscan be 3 Floppy (A) if it is required to save thedatabase to a floppy disk.

    Click on Save All.

    Module 5 Page 4 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    8/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Close the Database

    When the database is active on the screen, click on the File menu.

    Click on the Close option to close the specific database file.

    Click on the Exit option to exit out of Microsoft Access.

    Use Help Functions

    Access has a very comprehensive Help facility. The Help menu or theOffice Assistant can be used to obtain help.

    Click on the Help menu and the Office Assistant will be displayed.Type in a question and press Search.

    Click Microsoft Access Help on the Help menu. If theAssistant is turned on, it appears. If the Assistant is turned

    off, the Help window appears. To scroll through a table ofcontents for Help, click the Contents tab. This is verycomprehensive and covers most topics in Access. Double-click on the book icon beside the option to display furtherdetails. When an icon with a question mark is shown, clickon it for details on that topic. In the example to the right,the topic Working with Data has several sub-topics. Thesub-topics with the book icon have further sub-topics. Thetopics with the question mark icon have details on thattopic.

    To type a question in the Help window, click the Answer

    Wizard tab. The Index tab allows you to type in a wordor string of words. A list of related topics are displayed.Double-click on the required topic.

    To see a ScreenTip for a menu command, toolbar button,or screen region, click What's This? on the Help menuand then click the item you want information about.

    5.1.3 Adjust Basic Settings

    Change Viewing Modes

    When in the Database window, tables, queries, forms, reports, etc., can be viewed by clicking on theappropriate icon to the right of the Database window. Clicking View, DatabaseObjects can alsoactivate these views, and the corresponding viewfrom here selected.

    Module 5 Page 5 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    9/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Tables, queries, etc., within the database can be viewed as Large icons,Small icons, List orDetails. The standard view is List as evident from themenu on the right.

    Clicking the required button on the toolbar can access these options also.

    Display / Hide Toolbars

    Clicking on the View menu Toolbars option to list the toolbars that are available in Access. Thereare only two, the Database and Web toolbars. Clicking on a toolbar will display or hide it. Selectingthe Customise option displays all available command buttons. These buttons can be dragged ontothe toolbar and be available for future use. Click on Close in the Customise screen when complete.

    5.2 TABLES

    5.2.1 Main Operations

    Design and Plan a Database

    Before information is entered into a database, the goal and purpose of the database should first beidentified and a plan of how data is stored in it decided. The planning stage involves deciding howmany tables the database will involve and what data will be stored in each table. Although the tablecan be modified at any stage, up-front planning makes the process easier. In planning a database,the following guidelines should be considered:

    Determine the purpose of the database and give it a meaningful name.

    Determine the results or outputs from the information stored in a database.

    Collect all the information that will be used to produce the results.

    Sketch the structure of the table including each fields data type.

    Create a Table

    Select the Table tab in the Database window.

    Double-click on the Create Table in Design View option or alternatively click on theNew button and select the option Design View.

    Module 5 Page 6 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    10/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    The Table Design Grid appears where field names, data types, descriptions and field properties areentered.

    Field Name

    A field name can contain up to 64 characters and include letters, numbers, spaces and some specialcharacters.

    Data Type

    Data types are attributes that determine what kind of data a field can have. Datatypes are selected from a drop-down list and include:

    Text - which includes text or a combination of text and numbers that do notrequire calculations. This data type can be up to 255 characters.

    Memo includes lengthy text or a combination of text and numbers.

    Number this data type consists of numeric data to be used in calculations.

    Date/Time for date and time values.

    Currency for currency values.

    AutoNumber this is a unique sequential number that Access assigns to eachnew record; it cannot be edited.

    Yes/No for fields that will contain only one of two values Yes or No.

    Hyperlinks stores hyperlink addresses.

    Lookup Wizard - creates a field that displays either a Lookup List or a Value List, which makesdata entry simpler. A Lookup List displays values looked up from an existing table or query whilea Value List displays a fixed set of values that are entered when the field is created.

    Description

    An optional description can be entered for each field. The description, if added, appears in the statusbar when a field is selected for data entry or editing.

    Field Properties

    For each data type, field properties can be set. These determine the format, size and othercharacteristics of the data that affect its appearance and accuracy.

    When the table design is complete, click on the File,Save option or the Save icon onthe toolbar. The Save dialog box is displayed.

    Give the table an appropriate name and click on OK.Access will then prompt the user to set a primary key.Click on No.

    Click on the File menu.Choose the option Close.

    Module 5 Page 7 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    11/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Exercise 5.1

    1. Create a database called Employees.2. Insert the following field names and attributes in the table:

    Name TextAddress Text

    Date of Birth DateSalary Currency3. Save the table calling it Personnel Details.4. Do not set a primary key.5. Close the database.

    Enter Data into a Table

    Click on the table and click on Open to enter data into the table.

    Click on the New Record button or click into the first field in the first record and type in data.

    Press the Tab orEnterkey to advance to the next field.

    Continue to enter data in all fields for each record.

    Click on Save when complete.

    Exercise 5.2

    1. Open the database called Employees.2. Enter the following records into the table called Personnel Details.

    Name Address Date of Birth Salary

    John Martin Avoca Avenue 12/08/68 25000

    Mary Smith Bray Heights 05/01/72 22500

    Ann Kavanagh Mansion Estate 08/09/77 20000

    3. Save the table and close it.

    Modify Data

    Open the table that contains the records to be edited.

    The table is displayed in the Datasheetview. Click on the record to be edited, click into therequired field and type in the new details.

    First

    NewPrevious Next Last

    Module 5 Page 8 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    12/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Press the Tab orEnterkey to advance to the next field.

    Continue to edit data in all fields for each record.

    Click on the Save button on the toolbar to save changes.

    Delete Data in a Table

    Click into the field to be edited.Press Delete key orBackspace key.

    If data was incorrectly deleted, it can be undone by clicking on the Undo button on thetoolbar.

    Add Records to the Database

    With the table open, click on the New Record button at the bottom of the table or onthe toolbar or click on Insert,New Record.

    Enter new record details.

    Delete Records in a DatabaseClick on the Record Selectornext to the record that is to be deleted.

    Click on the Edit menu.

    Click on the option Delete Record orDelete icon on the toolbar. Access will confirmto the user that a record is being deleted and needs confirmation as to whether tocontinue.

    Once a record is deleted it is not possible to recover it again.

    Navigate throughout a Table

    At the bottom of the table in Datasheet view, there are a number of buttons used for navigatingthrough a table.

    Edit Record

    New Record

    Go to First Record

    Go to Previous Record

    Go to Next Record

    Go to Last Record

    Module 5 Page 9 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    13/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Delete a Table

    In the Database window, click on the table to be deleted and press the Delete key orthe Delete icon on the toolbar.

    A message is displayed confirming the deletion and click on OK if you wish toproceed with the deletion.

    Close a Table

    Click on the Table icon and click on the Close command or alternativelyclick on the Close Window button on the top right of the window.If changes were made to the layout of the table, you will be prompted to save thetable.

    5.2.2 Define Keys

    Define a Primary Key

    The power of a database system comes from its ability to quickly find and bring together informationstored in separate tables. In order to do this, each table should include a field that uniquely identifieseach record stored in the table. This information is called the primary key of the table. Once you

    designate a primary key for a table, to ensure uniqueness, Microsoft Access will prevent any duplicatevalues from being entered in the primary key fields.

    Assign a Field a Primary Key

    In the Design view, select the required field.

    Click on the Primary Key icon on the toolbar.

    Set up an Index

    An index in this context refers to the ordering and the uniqueness of values. When linking tables,indexes are used to ensure links work correctly. Linking tables is beyond the scope of this module.They help speed up queries which will be discussed later in this module but slow down data entry

    as indexes need to be updated each time data is entered. Indexes are set when designing the table.

    Open the table in Design view byclicking on the Table name andDesign in the Database window orif the table is displayed, click on theView, Design View command orclick on the Design icon on thetoolbar.

    Click on the field that is to beindexed and in the Field Propertiessection, click on the drop-downarrow beside Indexed (on theGeneral tab).

    A field can be indexed with:

    Module 5 Page 10 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    14/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Duplicates allowed used in the case of a persons name, where there may be more than oneoccurrence of the same name. SelectYes (Duplicates OK).

    Duplicates not allowed used in the case of a personal ID or PRSI number where more thanone occurrence is not allowed. SelectYes (No Duplicates).

    Close out of the tables Design view and Save it when prompted.

    5.2.3 Table Design / Layout

    Field Format Attributes

    Open the table in Design view by selecting the table and clicking the Design icon.

    Click on the field to be modified and edit its attributes by either changing its data typeor its field properties.

    Modify Field Size

    Click in the Field Size section of the dialog box and type in the required size, i.e. the number ofcharacters that the user will enter into this field.

    Modify Number Format

    Click on a field that has its data type set to Number.

    Click in the Format section of its field properties andfrom the drop-down arrow to the right of the Formatoption, select the desired format option.

    Modify Date Format

    In Design view, click on a field whose data type is set to Date/Time and click on the drop-downarrow to the right of the Format option and selected the desired format.

    Module 5 Page 11 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    15/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Click and dragto new locationClick to select

    Consequence of Changing Field Size Attributes

    If the field size is too small, the fieldwill not accept the data as you type itin the table.

    Validation Rule

    In the tables Design view, select a field to apply a validation to it, e.g. the Date/Time field.

    In the Field Properties section, click on the Validation Rule text box and enter criteria such as>=01/01/2000 which requires that dates prior to the 01/01/2000 will not be accepted by this field.

    Alternatively, click on the Expression Buildericon for help withcreating validation rules.Use the logical operators and type in the date as displayed below.Click on OK when complete.

    Move a Column within a Table

    Click on the Title of the field to be moved.

    Click on it a second time and drag it to the new location.

    Change Column Widths

    When a table is created, Access begins by making all the columns the same width. This may result insome of the data being hidden.

    Click on the dividing line between a title and the one to its right. The shape of the cursor changesto a double-sided arrow.

    Drag the cursor left or right until the column is the right size.

    Before changingcolumn widths

    After changingcolumn widths

    Module 5 Page 12 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    16/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Sort a Table

    Select the table to sort and click on Open.

    Click into the field that is to be sorted.

    Click on the Sort Ascending orSort Descending icon on the toolbar.

    Exercise 5.3

    1. Open the database Employees.2. Open the table Personnel Details.3. Add the following records:

    Name Address Date of Birth Salary

    Joe Slevin Main Street 23/07/65 21500

    Grainne Brophy Whitethorn Grove 05/05/75 24250

    Maire Moran Riverview 09/11/73 23400

    4. Change the column widths so that all field details can be viewed.5. Sort the table in ascending order on the Name field.6. Move the Date of Birth column after Salary column.7. Joe Slevin has moved from Main Street to Blackhorse Ave - modify this record to recall the

    change.8. Ann Kavanagh is no longer with the company delete this record.9. Marie Morans salary has been increased by 1000 - edit this record.10. Save the table and exit Access.

    Module 5 Page 13 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    17/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    5.2.4 Table Relationships

    One-To-One Relationship

    Click on the Tools menu and select Relationships.or click on the Relationship iconon the toolbar.

    If the Show Table dialog box is not displayed, click on the Show Table icon on theRelationship toolbar.

    Select the table to add from the list of tables displayed. Use the CTRL key to add morethan one table or the Shift key to select a block of tables.

    Click on Add and Close.

    The Relationship window resembles the screen below:

    To create the relationship link from a field in one table to a field in another table, simply drag thefield from the first table and drop it on top of the field in the second table.

    The Edit Relationships dialog box will be displayed showing the link between the two differenttables, in this case the Employee Number field.

    Module 5 Page 14 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    18/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Click on Create and a line appears in the Relationship window representing the link between thetwo tables.

    One-To-Many Relationships

    Click on the Relationship icon, the Show Table icon and select the tables.

    Click on Add and Close.

    In the example illustrated below, we wish to create a relationship between the Department Codefield in the Department Codes and Human Resource tables. The Department Code field in theDepartment Codes table is unique but in the Human Resource table, a repetitive DepartmentCode can be entered, as some employees will be in same departments. Therefore there is aneed to create a One-To-Many Relationship

    Drag the field Department Code from the Department Code table to the Department Code field inthe Human Resources table.

    Join type will display as One-To-Many and click the option to Enforce Referential Integrity toensure that changes made in Department Code table are replicated in the Human Resourcestable.

    Module 5 Page 15 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    19/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Click Create to display the relationship.

    Delete a Relationship

    In the Relationship window, click on the Relationship line that you wish to delete.

    Press the Delete key.

    In the dialog box displayed, click onYes to permanently delete the relationship.

    Relationship Rules

    When you create a relationship or double-click on an existing relationship in the Relationship window,the Edit Relationship dialog box is displayed.Relationship rules can be applied by clicking on Enforce Referential Integrity check box. Thisensures that relationships between records in related tables are valid. It means that the user will notbe able to accidentally modify related data.

    Cascade Update Related Fields means that if you change the primary key in the record of a primarytable, Access will update the corresponding fields in related records with the new value.

    Cascade Delete Related Records means that if a primary record is deleted, the correspondingrecords in related tables will be deleted.

    5.3 FORMS

    5.3.1 Working with Forms

    Open a Form

    Click on the Forms icon on the left of the Database window and select the form youwish to open.

    Click on the Open icon from the toolbar.

    Module 5 Page 16 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    20/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Create a Form

    In the Database window, click on the Forms tab and double-click on

    Create Form by using Wizard.

    Alternatively, click on New and the New Forms dialog box is displayed.

    Select the option Form Wizard.

    Select the table on which the form will be based.

    Click on OK and the dialog box below is displayed which lists all the fields in the selected table.

    Module 5 Page 17 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    21/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Add a single field Add all fields

    Remove a single field Remove all fields

    Select the field required in the form from theavailable fields list and click the Add Single Fieldbutton.

    Continue to select and add until all required fieldsare selected.

    Click on Next to display the Layout dialog box.

    Select the required layout from the four availableoptions:Columnar, Tabular, Datasheet and Justified.

    Click on Next and the Form Style dialog box isdisplayed.

    Select the required style from the list of availableoptions. As you click on each style, a preview isdisplayed on the left-hand side.

    Click on Next.

    The final dialog box suggests the table name as atitle for the form but this can be changed ifrequired.

    Click Finish and the form opens displaying thefields and data for the first record in the table.

    Module 5 Page 18 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    22/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Create a Form using the AutoForm Facility

    Forms can also be created using the AutoForm facility. This option creates a form either in aColumnar, Tabular or Datasheet layout depending on the AutoForm option selected. The user is notrequired to make any decisions, except to select the table or query on which the AutoForm is to bebased.

    Enter Data into Database using a Form

    Click on the New Record button on the Form View toolbar to display a new blank record.

    Enter information into the first field.

    Press the Tab key to advance to the next field and enter information into it.

    Continue to enter data for the record, pressing Tab to move from field to field.

    Modify Data in a Database using a Form

    Use the Record Navigation keys to display the record that you wish to alter. Modify as required.

    Delete Records using a Form

    Display the form for the record that you wish to delete.

    Click on the Delete Record icon.

    ClickYes if you wish to permanently delete the record.

    Form Navigation

    The Form Navigation bar is located at the bottom of the form:

    Go to First Record

    Go to Previous Record

    Go to Next Record

    Module 5 Page 19 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    23/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Go to Last Record

    Enter new Record

    Exercise 5.4

    1. Open the Employees database.2. Generate a simple form from the Personnel Details table and call it Details.3. Enter the following records into the table using the form:

    Name Address Date of Birth Salary

    Mary Mannion Broadstone 26/10/77 18000

    Stephen Ryan Rosbeg Woods 12/08/80 18250

    4. Close the form.5. Open the table to see the extra records.

    5.3.2 Modify Form Layout

    A form can be modified easily by changing the location of the fields, adding or deleting fields, addinggraphics, changing the colour of the background, text and field data, etc.

    A form is modified in Design view. Form design is divided into three sections:

    Form Headerappears at the beginning of each screen form and can contain a title or logo.

    Detail section displays the fields for each record.

    Form Footerappears at the bottom of each screen andcan contain totals, instructions or command buttons.

    Each element on a form is called a Control.A control consists of the field label and thedata it contains which is the field valuetext box. The appearance and propertiesassociated with a control can be changed.

    Field Label

    Value textboxForm Design View

    While in the Database window, select the Form tab.

    Select the required form and click on the Design iconand the Form Design screen is displayed.

    The forms background changes to a grid, which helpskeep fields aligned horizontally and vertically

    An extra toolbar, called Toolbox, which contains extra buttons that may be used tomodify the design, may also be displayed. If not click on the Toolboxicon on the toolbar to display it.

    Module 5 Page 20 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    24/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Format Text

    Both the field label and value text box are formatted to display infont style MS Sans Serif, font size 8. This can be formatted to anyother style or size by selecting options from the Font Style andFont Size icons on the toolbar. Text can also be emboldened or

    italicised using the corresponding icons on the toolbar. Differentcolours can also be applied to text by selecting the label and thenselecting the colour from the Text Colour icon on the toolbar.

    To Change the Font Style and Font Size of a Field Label

    Select the field label and click on the drop-down arrow beside the Font Style box to selectanother style.

    Click on the drop-down arrow beside the Size box and select a larger size.

    To Change the Font Style and Font Size of all Field Labels and Value Text boxes

    Select the field label, hold the Shift key down and select all other field label and value text boxes.

    Click on the drop-down arrow beside the Font Style box to select another style.

    Click on the drop-down arrow beside the Size box and select a larger size.

    To Change the Font Colour and Embolden a Label

    Select the label.

    Select a colour from the drop-down arrow on the Font Colouricon.

    Click on the Bold icon.

    Change Background Colours in a Form Layout

    Click on the Title bar labelled Detail.

    Select a colour from the drop-down list on the Fill/BackColouricon.

    Import an Image or Graphic into a Form

    Click on the form and then click on the Insert menu and select Picture.

    Locate the image or graphic from its required location, click on it and then click on OK to insertinto the form (use the View button to display a preview of the image).

    The image may have to be resized or moved within the form. This is achieved by selecting theimage and when the mouse shape appears as a flat-hand, move the image to the requiredlocation. Position the mouse on the corner of the image and when the mouse is a double-sidedarrow, drag to re-size

    The image properties must be amended so that the picture can be seen in the form.Select the picture and click on the Properties icon on the toolbar.

    On the Format tab, click in the Picture Size Mode box and select the option Zoom, whichadjusts the size of the image to the required size. Close the Properties screen.

    Module 5 Page 21 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    25/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Image when resized andbefore size mode is set.

    Image after size mode isset to Zoom.

    Add a Header to a Form

    Position the mouse between the Headerand Detail bars inthe form.

    When the mouse changes shape, drag it down to increasethe Header area.

    Click on the Label button on the Toolbox toolbar.

    Click into the Headerarea and hold down the mouse and drag to draw a text box.

    Click into the box and type an appropriate header for the form.

    Format the header as you format text (see above).

    Click on the View menu and Form View to display the form or alternatively click onthe View button.

    Design View

    Form View

    Module 5 Page 22 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    26/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Add a Footer to a Form

    A footer is added to a form in the same way as a header is added to a form.

    In Form Design view, drag the mouse below the footer area to display the footer.

    Click on the Label icon on the Toolbox toolbar.

    Click into the Footerarea and hold down the mouse and drag to draw a text box.

    Click into the box and type an appropriate footer for the form.

    Format the footer as you formatted text (see above).

    Change Arrangement of Objects within a Form

    Select the field by clicking the control for that field.

    Black squares called handles appear around the perimeter of the selected control.

    If the field label control is selected then only the label is selected, but if the field value text box isclicked then the field label is also selected.

    When the pointer changes shape, drag the control to its new location.

    Continue to select and drag each of the controls as required.

    Handles

    Delete a Form

    From the Database window, select the form to delete and click on the Delete iconon the toolbar.

    ClickYes to permanently delete the form.

    Save and Close a Form

    From the File menu, click on Save option.From File menu, click on Close.

    Exercise 5.5

    1. Open the form called Details in Design view.2. Position the Salary field to the right of the Date of Birth field.3. Put in a headerformatted in Arial, 12pt, Red and Bold.4. Change the colourof all the Value text boxes to blue and font size 10.5. Change the background colourin the Header area to Blue and in the Detail area to Red.6. View the form.7. Save and close the form.

    Module 5 Page 23 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    27/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    5.4 RETRIEVING INFORMATION

    5.4.1 Main Operations

    Find a RecordOpen a table within the database.

    Click on the Edit menu and select the option Find. Alternatively, click on theFind icon on the toolbar.

    Enter the data in the Find What text box.

    Click the drop-down arrow in the Look In boxand ensure that the whole table is accessedfor the data.

    All records can be searched for a whole field,part of a field or the start of a field.

    Wildcards can be used when searching fordata. Wildcards are symbols used as

    substitutes for characters in text:* represents any group of characters.? stands for any single character.# stands for a single digit.For example, to find any name beginning with S, type s* in the Find What text box.

    Apply a Filter

    Filters are simple queries but they only apply to open tables or forms. They are best used fortemporarily altering the view of the data in a table such as filtering out records not required, viewingrecords that meet complex criteria, sorting records on content of several fields, etc.

    Filter by Selection in a Table

    Open a database table.Click into the cell containing the item that you wish to filter on.

    Click on the Filter by Selection icon on the toolbar to display the filtered data as below. Data isfiltered on the County field as Dublin.

    Remove a Filter

    Click on the Remove Filtericon on the toolbar.

    Filter by Form

    In the Database Table view, click into the field that you want to filter out data.

    Click on the Filter by Form icon.

    Module 5 Page 24 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    28/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    The table is redisplayed with a drop-down arrow beside the field that is to be filtered and thestatus bar contains two tabs a Look fortab and an Ortab.

    Select the required county from the drop-down field. If more that one option is required, click onthe Ortab (a second Or tab will appear) and reselect another county on which to filter data.

    Click on the Apply Filtericon to display all related records.

    Remove Filter by Form

    Click on the Remove Filtericon on the toolbar.

    5.4.2 Queries

    Create a Simple Query

    A query is used to search through a database to locate a particular record or records that conforms tospecified criteria. These are collected into a special kind of table called a Dynaset. Queries aredeveloped by using the Query Wizard or by directly specifying requested fields and query criteria inthe Query Design view. The resulting query datasheet is not a duplication of the data that resides inthe original tables datasheet but rather a logical view of the data. If changes are made in the querydatasheet, the data in the underlying table is updated automatically.

    In the Database window, click on the Query tab.

    Double-click on Create Query in Design View or alternatively click on New and the New Querydialog box is displayed.

    Module 5 Page 25 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    29/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Select the option Design View.

    Click on OK.

    The Show Table dialog box is displayed showing thetables available on which a query can be performed.

    Select the required table from the list.

    Click on Add.

    Click on Close to close this Show Table window.The Select Query window displays the field namesbelonging to the selected table in the upper part ofthe window and the lower half, called the query grid,is used to specify the fields to display and for whatrecords they are to be displayed.

    Point and drag each field name required from thetable list into a separate column in the query grid.

    Click in the Criteria box under the field name and type in the data on which the query is to baseits selection.

    Click on the View menu and select Datasheet to perform thequery or select it from the toolbar. Alternatively, click on the Run

    icon from the toolbar.A Dynaset consisting of all qualifying records is displayed.

    Query Grid

    Table

    Field Names

    Save a Query

    Click on the File menu.

    Click the option Save and give the query anappropriate name.

    Click on OK.

    Click on File menu.

    Click on Close.

    Module 5 Page 26 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    30/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Run a Query

    From the Query Designview, click on the Run icon on the toolbar.

    From the Database window, click on Queries and the required query from the previously createdqueries and click Open.

    Delete a Query

    From the Database window, click on Queries and the required query from the previouslycreated queries and click the Delete icon.

    Click onYes to permanently delete the query.

    Create a Query with Multiple Criteria

    The criteria specified for a query can be as simple as a list of customer names or as complex as a listof all customers over the age of 40, who live in Dublin and Galway. By using expressions,combinations of field names and arithmetic operators, the numbers of records returned by a querycan be restricted. The arithmetic operators used in criteria when creating queries include: greaterthan; < less than; = equals; >= greater than or equal to;

  • 8/6/2019 ECDL Module 5 2000

    31/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    The wildcard * can also be used to find variations of text entered. If D* is entered into the criteria rowunder the City field, all records will be displayed for customers living in a city that begins with the letterD, e.g. Derry, Dublin, Dundalk, etc.

    Between 1/1/2000 and 1/1/2001 will select specific records falling within this range of dates.Alternatively the operators >=1/1/2000 and ,>=,

  • 8/6/2019 ECDL Module 5 2000

    32/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Select the fields that might have duplicates and click on Next.

    Select the fields to view if duplications are located and click on Next.

    Give the query an appropriate name.

    Click on Finish and the results of the Find Duplicate Query are displayed.

    Exercise 5.6

    1. Open the database Employees.2. Create a query on the Personnel Details table listing all those whose salary is greater than

    22000.3. Run the query and save the result as Salary greater than 22000.

    Add Fields to a Query

    In the Query Design view, click on the field nameand drag onto the query grid to add that field to aquery. Alternatively, double-click on the field name

    and it will automatically be inserted onto the grid. Ifthe table is not displayed, click on the Show Tableicon on the toolbar.

    Remove Fields from a Query

    Position the mouse over the field to be removed from the query grid. When the mouse changesshape to a black arrow pointing down, click on the Delete key or alternatively remove the tick from theshow box as displayed below.

    Module 5 Page 29 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    33/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Hide Fields in a Query

    In Query Design view displaying the query grid, remove the tick in the checkbox beneath the field tohide. The screen below shows the field Employee Number, which will not now be displayed when yourun the query.

    5.4.3 Sort Records

    Sort Data based on a Query

    In the query design grid, click into the Show box to display records in the Dynaset matching thespecified criteria. Removing the tick mark in the Show box will not display that field in the Dynaset butwill apply the criteria.

    To sort data in ascending or descending order in a query, click on the drop-down arrow in the Sortrow of the field to be sorted and select either the Ascending orDescending option.

    Sort Data based on Common Logical Operators

    In the query design grid on the sort row of the field that has a criteria set, select the sort optionrequired.If you do not wish to show the records on which the query is based, remove the tick from the Showbox.

    Show removed

    Sort Order

    If you do not want to displayrecords, remove the tick fromShow box.

    Displays records where the cityis Galway or the date is afterthe 12/5/2000. Records aresorted LastName in Ascendingsequence while the City field isnot displayed in the result.

    Module 5 Page 30 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    34/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Sort a Table

    Select the table to sort andclick on Open.

    Click into the field that is to besorted.

    Click on the Sort AscendingorSort Descending icon onthe toolbar.

    Sort a Form

    Open the form.

    Click into the field that is to be sorted.

    Click on the Sort Ascending orSort Descending icon on the toolbar.

    Exercise 5.7

    1. Create a query displaying all those born between 1972 and 1975. Do not show the address fieldin this query.

    2. Sort the query according to Salary in descending order.3. Save the query as 1972 to 1975.

    Module 5 Page 31 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    35/48

  • 8/6/2019 ECDL Module 5 2000

    36/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    The report can be sorted in a specific order by selecting the required field name from the drop-down list of field names.

    Click Next to select the required layout and page orientation from this dialog box.

    Click Next to select a suitable report style from the available options.

    Module 5 Page 33 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    37/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Click Next and give the report a suitable name.

    Click Finish. Access compiles the report and displays it in the Print Preview window.

    Module 5 Page 34 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    38/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Modify a Report

    Modifications to the formatting of a report such as bolding column headings or changing the alignmentof fields in a column can be made in the Report Design window. The Report Design window isdivided into designated areas called sections in which controls and formatting specifications areplaced.

    Report Header- appears only at the top of the first page of the report and usually contains the reportname or company logo.Page Header- appears at the top of every page (but below the report header on the first page) andusually contains the field labels.Group Header- appears at the top of each group of records (Group is replaced by the field name).Detail - appears once for every record in the underlying datasheet and usually contains bound fieldtext boxes.Group Footer- appears at the end of each group of records and usually contains summaryinformation on the group of records such as total values, etc.Page Footer - appears at the end of each page and usually contains the current date and pagenumber.Report Footer- appears at the end of the last page of the report.

    A Toolbox toolbar is also displayed in the Design View window.

    This contains tools that will be used in modifying a report.

    Align Fields and Format Text in Header and Detail Sections

    Press and hold down the Shift key and click on each ofthe control headings in the Page Headersection of theReport Design window.

    Click Centre button on the Formatting toolbar.

    Click the Font Size drop-down arrow to increase the font size from the default size 8.

    Hold the Shift key down while clicking on each of the controls in the Detail section.

    Release the Shift key and click the Centre button.

    Delete a Control

    Click on the control to select it.

    Press Delete and the control is deleted.

    Create and Customise Headers and Footers

    In the Report Design view, click the Label tool on the Toolbox toolbar.

    Click in the Report Headersection and type in an appropriate header for the report.

    Module 5 Page 35 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    39/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Select the control and apply suitable formatting to the text such as increase font size, bold andfont colour.

    Design View

    Click on the View menu and select Print Preview or alternatively click on the Previewicon.

    Print Preview

    Click the Label tool into the Report Footersection and type a descriptive

    footer.Select the control and apply suitable formatting as for the header.

    Click on the Print Preview icon to preview.

    Group Data in Reports using the Wizard

    When generating a report initially using the Report Wizard, a dialog box enquires if a grouped reportis required. If fields are to be grouped within a report, select the fields from this dialog box. Click onthe SummaryOptions button.

    Module 5 Page 36 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    40/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Select the required function and if a DetailandSummary report is required. This will display sub-totals at the end of each grouped field. Click OK and follow the wizard options as for a SimpleReport.

    Group Data in a Report

    In Design view, select the Sorting and Grouping command from the View menu.

    Click within the Field / Expression column and select the field to apply grouping to.

    By default the field will be sorted into ascending order. To change this, click within the SortOrdercolumn and choose Descending from the menu.

    Click on the Close icon in the top right of the dialog box to apply the grouping and sorting options.

    Switch back to Print Preview to see results.

    Delete a Report

    From the Database window, select the report to delete and click on the Delete iconfrom the toolbar.

    ClickYes to permanently delete the report.

    Module 5 Page 37 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    41/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Exercise 5.8

    1. Generate a report based on the Personnel Details table in the Employees database.2. Sort the report in ascending order on the name field.3. Preview the report.4. Save the report as Employee Details.

    Exercise 5.9

    1. Generate a grouped report, grouped on the Salary field. Do not show the address field in thisreport.

    2. Preview the report and save it as Salary.3. Modify this report and insert a header - Employees Salaries.4. Format the header using the font style Arial, Size 16 and colour Blue.5. Preview the report and save it.

    5.6 PREPARE OUTPUTS

    5.6.1 Prepare to Print

    Preview

    Select the object to preview, e.g. table, form, query or report.

    Click on the File menu and Print Preview.

    Change Report Orientation

    Select the report.Click on the File menu and Page Setup.

    From the Page tab, select the required Orientation.

    Change Paper Size

    Select the report.

    Click on the File menu and Page Setup.From the Page tab, select the required paper size in the Papersection.

    Module 5 Page 38 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    42/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Print Table Options

    Open the table and select the required records.

    From the File menu, select the Print option and in the Print Range section, specify to print All orthe number of pages to print or the selected records.

    Print from Form

    Open the required form.

    From the File menu, select the Print option and in the Print Range section, specify to print All orthe number of pages to print or the selected record.

    Print Result of a Query

    Display the query that you want to print from.

    Click on the Print icon to print the entire query result. If only part of the query is required thenselect the File menu and the Print command.

    Within the displayed dialog box, select what you want to print.

    Print a Report

    Open the required report.

    From the File menu, select the Print option and within the Print Range section, specify to printAll or the number of pages to print or the selected record.

    Module 5 Page 39 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    43/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    5.7 EXTRA EXERCISES

    Exercise 1 Covering topics 5.1 to 5.4.3

    1. Open the database application and create a database called Friends2. Insert the following field names and data types in the table:

    Name Text Address TextBirthday DateNo of Children Number

    3. Save the table as Personal Details.4. Do not set a primary key.5. Close the database.6. Exit the application.7. Open the Access application and open the database called Friends.

    8. Open the table Personal Details and enter the following records:

    Name Address Birthday No of ChildrenMichael Mangan 16 The Pines 12/07/1969 3Sharon Smyth 24 Beech Lawn 05/10/1972 1Jean Cooke 8 Willow Green 18/02/1959 4Sean Mullins 31 Oak Lawn 30/04/1962 2

    9. Sort the table on the Name field.10. Close the table and exit the application.

    Module 5 Page 40 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    44/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Exercise 2 Covering topics from 5.1 to 5.4.3

    1. Open the database application and create a database called Hotels.2. Insert the following field names and data types in the table:

    Name Text

    Location TextCost per Night CurrencyNo of Rooms Number

    3. Save the table as General Details.4. Enter the following records into the table:

    Name Location Cost per Night No of RoomsGrosvenor Cork 45 120Royal Park Dublin 86 80Mammoth Galway 50 95Salas Dublin 75 100

    5. Sort the table on Location.6. Add another field to the table called Manager and set the required data type.7. Add a managers name into the new field on the table for each hotel.8. Change the order of fields in the table so that the Manager field appears after the Name field.9. Adjust the column widths so that field details can be viewed.10. Exit the application.

    Exercise 3 Covering topics from 5.1 to 5.4.3

    1. Open the database created in Exercise 2 called Hotels.2. Open the table created in Exercise 2 called General Details.3. The Mammoth Hotel has changed ownership and is now called Fawlty Towers and charges 65 a

    night. Modify this record to reflect these changes.4. The Grosvenor Hotel has closed for renovations so delete this record.5. The Salas Hotel has 110 rooms not 100 modify this record.6. Add the following hotel to the table:

    Name Location Cost per Night No of RoomsStarlight Cork 50 70

    7. Sort the table on Hotel Name.8. Exit the application.

    Module 5 Page 41 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    45/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Exercise 4 Covering topics from 5.1 to 5.4.3

    1. Open the database application.2. Create a new database called Videos.3. Create a table called Stockwith the following fields and data types:

    Name TextClassification TextIssue Date DateCost Currency

    4. Enter the following records into the table:

    Name Classification Issue Date Cost Angelas Ashes Historic 15/01/2000 25Notting Hill Drama 12/11/1999 20The Full Monty Comedy 01/03/1998 12Scream Horror 06/06/1997 9

    5. Sort the table according to Classification.6. Using the Find icon, locate the record for the film Notting Hill.7. Edit the classification of this film to Comedy.8. Create a simple form from the Stock table and called it Stock Details.9. Enter the following record using the form:

    Name Classification Issue Date CostTrainspotting Comedy 10/05/1998 15.50

    10. Close the application.

    Exercise 5 Covering topics from 5.1 to 5.4.3

    1. Open the database called Videos created in Exercise 6.2. Open the form Stock Details in Design view and add a header called Stock Inventory.3. Format this header to display as Arial, 18, Bold and in Yellow.4. Format all field labels and value text boxes to Arial, 10 and also Yellow.5. Adjust the width of label names if necessary.6. Change the background colour of the form to Blue.7. View the form.8. Close the form and exit the application.

    Module 5 Page 42 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    46/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Exercise 6 Covering topics from 5.1 to 5.4.3

    1. Open the Access application.2. Create a new database called Tours.3. Within this database, design a table to include the following field names and data types:

    Tour Name TextDestination TextDate DateCost CurrencyPlaces Number

    4. Save the table as Trips.5. Enter the following records into the table:

    Tour Name Destination Date Cost PlacesFlyaway France 12/8/2002 250 15Dream Trip Germany 24/7/2002 300 20Wild Hike France 20/8/2002 280 18

    Road Runner Austria 29/7/2002 320 5High Sights Germany 22/8/2002 305 10

    6. Close the table.7. Create a form based on this table with the title Tour Details.8. In Form Design view, insert a header called Future Tours.9. Format this header to Tahoma, 16 and Bold and change the background colour of the whole form

    to green.10. Close the form.

    Exercise 7 Covering topics from 5.1 to 5.4.3

    1. Open the database called Tours created in Exercise 6.2. Create a query to show all the tours to France.3. Save this query as French Tours.4. Create a query to show all tours during August 2002, call this queryAugust Tours.5. Create a query to show the tour name and cost of tours with less than 15 places available. Sort

    this query in ascending order by Tour Name.6. Save the query as Under 15 Places.7. Exit the application.

    Module 5 Page 43 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    47/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Exercise 8 Covering topics from 5.1 to 5.5.1

    1. Open the Access application.2. Create a new database calledAccommodation.3. Within this database, design a table to include the following field names and data types:

    Hotel Name TextRooms NumberRating TextCost CurrencyRooms Free Number

    4. Save the table as Hotels.5. Enter the following records into this table:

    Hotel Name Rooms Rating Cost Rooms FreeGrande 120 **** 80 5Rio 80 ** 35 10Superior 100 **** 75 0

    Roco 70 *** 65 14Samba 130 *** 40 3 Albatros 100 **** 50 0

    6. Sort the table in ascending order by Hotel Name.7. Create a query to display all records that have a rating of ***8. Save this query as 3 Stars.9. Close the application.

    Exercise 9 Covering topics from 5.1 to 5.5.1

    1. Open the database calledAccommodation created in Exercise 8.

    2. Create a query to display the Hotel Name, Rating and Cost of hotels that have more than 10rooms free.

    3. Save this query as Free.4. Generate a query to display in ascending order by Rooms, the Hotel Name, Cost and Rating of

    Hotels that cost between 35 and 55 and have a free room.5. Save this query as 35 to 55 free.6. Generate a report based on the table Hotels and sort it according to Hotel Name and save it as

    Accommodation 2002.7. Generate a grouped report, grouped by Ratings and based on the table Hotels and save it as

    Ratings for Hotels.8. Format the report title using Font style Arial, size 18 and Blue text colour.9. Preview the report and close it.10. Exit the application.

    Module 5 Page 44 Unauthorised Photocopying is Unlawful

  • 8/6/2019 ECDL Module 5 2000

    48/48

    OlasIT 2003 ECDL/ICDL Module 5 Database/Filing Systems

    Exercise 10 Covering topics from 5.1 to 5.5.1

    1. Open the Access application.2. Create a new database calledAlbums.3. Within this database design a table to display the following fields and data types:

    Artist Text Album TextDate Sold DateCost Currency

    4. Save the table asArtists.5. Enter the following records into the table:

    Artist Album Date Sold CostMeatloaf Bat out of Hell 12/11/2001 15.50U2 Pop 05/12/2001 20.99Prodigy Fat of the Land 14/01/2002 18.50Oasis This is Now 06/07/2001 12.50

    U2 Joshua Tree 02/01/2002 14.99Oasis Whats the Story 25/10/2001 22.50

    6. Generate a query based on this table to show albums by Oasis.7. Remove the field cost from this query and sort by Date Sold in ascending order.8. Save the query as Oasis.9. Close the application.

    Exercise 10 Covering topics from 5.1 to 5.5.1

    1. Open the database calledAlbums created in Exercise 102. Show all albums sold during 2001 and save it as 2001 Sales.

    3. Generate a grouped report, grouped on artist, based on the table Artists.4. Give the report a title called Sales by Artist.5. Format the header as Tahoma, 18, Bold and Italics.6. Remove the field Cost from this report.7. Preview the report and save it as Sales by Artist.8. Exit the application.