+ All Categories
Home > Documents > Access Using 2010 Manual

Access Using 2010 Manual

Date post: 05-Apr-2018
Category:
Upload: -
View: 217 times
Download: 0 times
Share this document with a friend

of 28

Transcript
  • 7/31/2019 Access Using 2010 Manual

    1/28

    UCLINFORMATION SERVICES DIVISIONINFORMATION SYSTEMS

    Document No. IS-146

    Access 2010

    Using AccessDatabases

  • 7/31/2019 Access Using 2010 Manual

    2/28

  • 7/31/2019 Access Using 2010 Manual

    3/28

    Document No. IS-146 September 2008

    ContentsIntroduction to Microsoft Access 2003 ........................................................................................... 1

    Microsoft Access 2010 features 1 Databases and database objects 2

    Opening objects 4

    Working with multiple objects 4 Saving in Access 4 Copying database objects 5 Closing a database 5 Renaming database objects 5 Customising and grouping 6

    Data navigation and entry ............................................................................................................. 7 Data navigation 7

    Data selection and editing ............................................................................................................ 11 Selecting data in tables 11 Selecting data in forms 11 Editing data 11 Copying and moving data 12 Deleting records 13 Using the undo facility 13

    Customising datasheets ............................................................................................................... 14 Changing the appearance of a datasheet 14 Re-organising fields 14 More field and row options 15 Sorting records 16

    Locating data ................................................................................................................................ 18 Search 18 Find and Replace 18 Filtering records in a table or form 20 Criteria 22

    Introduction This guide has been prepared to help users who wish to learn how to use an existing Access databasefor data entry and for extracting simple information. It is not intended for those who wish to develop

    databases from scratch. This guide can be used as a reference or tutorial document. To assist yourlearning, a series of practical tasks are available in a separate document. You can download the training files used in this guide from the IS training web site at: www.ucl.ac.uk/isd/common/resources/

    We also offer a range of IT training for both staff and students including scheduled courses, one-to-one support and a wide range of self-study materials online. Please visit

    www.ucl.ac.uk/isd/common/resources/ for more details.

  • 7/31/2019 Access Using 2010 Manual

    4/28

  • 7/31/2019 Access Using 2010 Manual

    5/28

    UCL Information Systems 1 Introduction to Microsoft Access 2010

    Introduction to Microsoft Access 2010What is a database?

    A database is a collection of related data. There are many everyday examples of databases such as: anaddress book containing names and addresses of friends and families; a card file holding details of business contacts; a filing cabinet holding last years financial reports. All these are stores for data, or inother words databases.

    What is Microsoft Access? Access is a software application for managing databases. Access enables you to store, retrieve, organiseand analyse data stored in a database.

    Microsoft Access 2010 features

    Backstage view (File tab)

    When you first launch the Access 2010 application you are presented with the backstage view. Fromhere you can perform most of the central operations that affect the whole database such as opening,closing and saving databases. Recently opened databases appear here. You can access this view at any time by clicking on the File tab of the Ribbon (see Ribbon and Tabs below).

    Ribbon and Tabs The ribbon is divided into several tabs, some of which are always available and some appear according to which task you are carrying out. Buttons may be greyed out if they are for functions you cantperform at that time. The Home tab contains most of the most commonly used features such as theformatting buttons.

    Click on the expand button to view more options, usually in the form of a dialog box.

    Quick Access Toolbar This is above the ribbon and allows you to perform certain functions quickly. Be default it containsbuttons to save, undo and redo. Click on the drop-down arrow to customise the toolbar by adding new buttons.

    Status bar The Status bar at the bottom of the screen displays status messages on the left and locking keys on theright. There are also buttons to change the view of the current object on the far right of the status bar.

  • 7/31/2019 Access Using 2010 Manual

    6/28

    Introduction to Microsoft Access 2010 2 UCL Information Systems

    The Navigation Pane When you open a database, the Navigation Pane will show you the various objects (tables, queries, forms,reports, macros and modules) that make up that database. This acts as the control centre for thedatabase.

    Click on the drop-down arrow to group and

    filter your objects:Select Object Type and All Access Objects tosee objects grouped by type and to see all of them.

    Select Object Type and Tables to just seetables.

    Tables and Related views groups objectsaccording to whether they are linked to aspecific table.

    Select Custom to create your own groups (see

  • 7/31/2019 Access Using 2010 Manual

    7/28

    UCL Information Systems 3 Introduction to Microsoft Access 2010

    Customising and grouping on page 6).

    Opening a databaseGo to the Backstage View (File tab) and click on Recent and open the relevant database if it is arecently opened one or click on Open to browse to the appropriate database on your drives.

    You may see a security message asking you if you wish toEnable Content .

    This is because Access believes the database could contain viruses or other malicious content. If youbelieve the database to be safe, click on Enable Content to make the database fully available.

    You may then be asked if you wanted to make the database Trusted Content . This will mean that youno longer be asked security questions about this database in future. Use the Help provided for more

    information.

  • 7/31/2019 Access Using 2010 Manual

    8/28

    Introduction to Microsoft Access 2010 4 UCL Information Systems

    Database objects An Access database can be perceived as a file in which different database objects can be stored.

    The most fundamental object is the table object: this is where the data is stored in the database. The otherdatabase objects, listed below, are tools that allow the user to manipulate the data held in the table.

    A query is a tool that allows the user to request specific data to be gathered from the database. A form provides the user with an alternative interface for entering, editing and viewing data. A report is a tool for producing formatted printed output from the database. A macrois an Object that allows the database to be automated without the need for programming. A module is an Object that stores Access code written by the user.

    In this course we will be looking at the table , query , form and report objects.

    Tables, fields and records A table is a collection of related data.

    Tables organise data into columns (called fields ) and rows (called records ) as shown below. Each record relates to a single entity (in this example, to a single customer); and each field is used to store a particularpiece of information about that customer (in this example, the company name, contact name etc.).

    Relationships The tables in a database may be linked to each other by the creation of relationships between specificfields in the database. These relationships can be viewed in the Relationships window:

    Select Relationships on the Database Tools tab

    Fields

    Records

  • 7/31/2019 Access Using 2010 Manual

    9/28

    UCL Information Systems 5 Introduction to Microsoft Access 2010

    Opening objectsEach Object you open in a database appears as a separate window within Access and you can havemultiple objects open at the same time. You can use the Switch Windows button on the Home tab toarrange the windows in different ways.

    To open an Object:

    Double click the object in the navigation pane. This opens the object in the view which allows you tosee the data (see below for more details).

    Views Objects can be opened in two or more views. The Design view is used for creating and modifying objects. The other views vary according to the type of object. All the objects we will be working withuse these other views for viewing data.

    Opening an object by double clicking opens them in the default view for navigating, entering ormodifying data. In the case of a table, this is the Datasheet view and in a form, Form view. To open anobject in Design view, right click on the Object and select Design View .

    To switch views in an open Object:

    Use the View button on the Home tab. Click on the button to toggle betweenDesign View (left) and Datasheet view (centre) or Form view (right) or use the drop-down arrow for more options.

    Working with objects Access has two different options for working with multiple object windows: Overlapping Windows and Tabbed Documents . It is recommended that you use the Tabbed Documents option. When youopen additional Objects, these appear as tabs below the ribbon.

    Click on an Objects tab to view it.

    Click on the cross on the grey bar to close the current Object.

    Helpful hint:

    Databases created in Access 2003 or earlier will use Overlapping Windows not Tabbed Documents.To change to Tabbed Documents:

    1. On the File tab, select Options and then Current Database .

    2. Under Document Window Options select Tabbed Documents and tick the Display Document tabs check box. You will need to close and re-open the database to see the changes.

    Saving in Access

    The Save command is accessed as in other Microsoft Office applications, by using the button on theQuick Access Toolbar or pressing Ctrl + S. However, it works slightly differently in Access.

    Access automatically saves the data in a record when the focus leaves it. In other words, Access saves arecords data when y ou move to a new record; close the active form, table or database; or exit Access.

  • 7/31/2019 Access Using 2010 Manual

    10/28

    Introduction to Microsoft Access 2010 6 UCL Information Systems

    The Save command does not save data. It is used to save and name new database objects, such as Tables, Forms and Queries. It is also used to save the design, layout, or structure of a database objectand replace any previous version.

    Save As command These are in the Backstage View , accessed by clicking on the File tab. Save Object As command canbe used to save a copy of the active database object under a different name. The Save Database As command can be used to make a copy of the current database.

    Copying database objects As well as being able to use the Save As command to create copies of objects, you can also create copiesof objects using the Copy and Paste commands:

    1. Right-click on the object you wish to copy.

    2. Select Copy from the pop-up menu which appears.

    3. Right-click on a blank area of the database window.4. Select Paste from the menu.

    5. Type a name for the copied object and click OK .

    Closing a databaseIt is always good practice to close any objects in a database when you have finished working on themand before closing the database. Access does not allow more than one database to be open at a time.

    To close an object:Click on the cross in the top right corner of the window.

    Closing the database:

    Click on the File tab and click on Close database .

    Renaming database objectsDatabase objects can be renamed Navigation Pane:

    1. Right-click on the object you wish to copy.

    2. Select Rename from the pop-up menu which appears. The o bjects name will be selected andeditable.

    3. Type the new name for the object.

    4. Press the Enter key to confirm the new name.

    Helpful hint:1. An object cannot have the same name as an existing object of the same type.

    2. An object cannot be renamed while it is open.

  • 7/31/2019 Access Using 2010 Manual

    11/28

    UCL Information Systems 7 Introduction to Microsoft Access 2010

    Customising and grouping You can organise different types of Access objects into a Group. For example, you can create a groupfor any objects you use to complete a particular set of tasks or that are used by a particular person. Youcan also create a group for your favouriteobjects that you use most often.

    A Group consists of shortcuts to the database objects that belong to it. Adding an object to a groupdoes not change that object's original location and all objects of a particular type will still appear whenyou click on that object type in the Navigation Pane. For example, when you click on Tables in theobject list, all Tables will be displayed even if they are also part of a group.

    Deleting a database object shortcut from a group does not delete the object itself. For example, if youdelete a form shortcut from your group, and then view Forms in the Navigation Pane, that form stillappears in the list of all forms.

    To create a group :

    1. Click on Custom on the Navigation Pane drop-down menu. A new group called Custom Group 1 will be created.

    2. Right-click on the Group and select Rename to change the name (e.g. Favourites)3. Drag objects from the Unassigned Objects list onto the name of the Group to add shortcuts to it.

    The process above creates groups on the Custom category but you can also rename Custom and createfurther categories and then create groups within these categories.

    To create additional categories and groups:Right-click on the top bar of the Navigation Pane and select Navigation Options . From here you canrename the Custom group, create additional categories and create additional groups within these.

  • 7/31/2019 Access Using 2010 Manual

    12/28

    Data navigation and entry 8 UCL Information Systems

    Data navigation and entryData navigation

    This section looks at some of the different ways to navigate through your data. Differences between

    form and table navigation will be highlighted in this section. As you move from record to record in a table, the record selector for the current record and the fieldname(s) for the current fields are highlighted in yellow. The specific cells that are selected are shaded inblue with a yellow highlighted border.

    Using Go To This allows you to move straight to the first, last, next, previous, or a new record.

    1. Click on Go To on the Home Tab.

    2. Select the option you require from the submenu.

    Using the navigation barOne of the most efficient ways to move between records in large databases is with the navigationbuttons in the lower left-hand corner of the window:

    Using the keyboard You can use various keys on the keyboard to move around the datasheet or form:

    Keys Table action Form action

    , Tab ,

    Enter

    One field at a time:

    Field above

    Previous fieldField to the right

    Next field

    Next field

    One field at a time*

    Previous field

    Previous fieldNext field

    Next field

    -

    End

    Home

    Move to last field in current record.

    Move to first field in current record.

    Ctrl + End

    Ctrl + Home

    Move to last field in last record.

    Move to first field in first record.

    Click here (or press F5 ) and type the recordnumber you want and press Enter .

    Previous recordFirst record

    Next record

    New record

    Last record

  • 7/31/2019 Access Using 2010 Manual

    13/28

    UCL Information Systems 9 Data navigation and entry

    Helpful hint:When viewing a form in Form view, the order of movement between fields is governed by the tab orderwhich forms part of the Form design.

    Navigation and Editing modes There are two modes available in the Datasheet view, Navigation mode and Editing mode.

    Navigation mode In Navigation mode, the cursor keys on the keyboard will move you from cell to cell, selecting the entirecontents of each cell ( see below).

    Editing mode In Editing mode the insertion cursor appears, and the same keys will move you from character tocharacter within a cell (see below ).

    When you click with the mouse in a cell you are in Editing mode by default. You can toggle between

    the two modes by pressing the F2 key. If you are in Editing mode in a cell you will be returned toNavigation mode when you leave the cell.

    Data entry This section covers techniques for entering new records in forms and tables.

    To follow the steps below, you will first need to open a form in Form view or a table in Datasheet view.See previous sections for more details.

    Adding a new recordEvery form or datasheet has a blank record which follows the last existing record. If there are norecords, the blank record is the only record. This blank record is reserved for new data.

    There are a number of ways to navigate to the new blank record at the end of your data including:

    Click on the New Record button in the Navigation bar (see Record selector symbols below) or Click on Go To on the Home Tab and select New Record or

    Type your data in the first field and press Tab to move to the next field. The record selector symbolschange as you work. (SeeRecord selector symbols below for a key to the symbols). Repeat the step above until you reach the last field. Pressing Tab from the last field automatically movesto the first field of the next record and automatically saves the record.

  • 7/31/2019 Access Using 2010 Manual

    14/28

    Data navigation and entry 10 UCL Information Systems

    Data Entry Tips Autonumber field(contains the word (New) in a new blank record)

    Press tab to skip data entry in this field as Accesswill automatically create a value in this field.

    Check box Press the space bar to check or uncheck the box.

    Enter the current date CTRL + ; (semi-colon)

    Enter the current time CTRL + SHIFT + ; (semi-colon)

    Record selector symbols Access displays the following symbols in the record selector (the grey area to the left of each record):

    Indicates the blank new record

    Indicates the current record when it is being edited (changed).

    Helpful hint:Depending on the design of the form, the record selector symbol may not be visible.

    Saving a record As you move from one record to another, the data in the previous record is automatically saved. Thisalso applies if you leave the record at any time, for example if you use the mouse to click on a non-adjacent record.

    Quitting a record without saving You can use the Esc key to cancel the current entry if problems arise when inputting data, for example

    if you receive an error message or make a mistake. Press once to leave the current field without saving any changes. Press twice to leave the current record without saving any changes.

    Data types The data you may enter in a specific field will depend on the data types and properties of the field. Thefollowing information covers some of the common restrictions. Access will display an error messagedialog box if you try to break the data entry rules.

    Primary key fields

    Each record in a database must have a value which is unique to that particular record. This ensuresthat the record is uniquely identifiable. For example, if the Employees Table had two employees with firstname John and last name Smith , the Employee ID would act as a unique reference or ID number. This isknown in database terminology as a primary key .

    In some cases, this field might be set to be an Autonumber. In this case, Access automatically creates anumber to identify the record, starting from the number 1 and working upwards, never using the samenumber twice. When entering a new record, Autonumber fields can be ignored: Access will automatically create an Autonumber as soon as you begin entering data in the record.

    Foreign key fields

    These are fields which are linked to a field in another table in order to create a link or relationship torecords in that table. For example, the Orders Table contains a CustomerID Field which must contain aCustomerID from the Customers Table . This enables us to know which customer has placed the order and

  • 7/31/2019 Access Using 2010 Manual

    15/28

    UCL Information Systems 11 Data navigation and entry

    what their details are. It many cases, data entry in a Foreign key field is limited to a value in the field it isrelated to. In the example above, the CustomerID field in the Orders Table must contain an existing CustomerID from the Customers Table and no other values may be entered.

    Date/time fields Data entered in these fields should be in a standard date or time format, e.g. 31/10/04 or 16:30. Acalendar icon appears next to dat e/time fields to allow you to pick a date from the calendar.

    Drop-down lists Some fields may be set up as drop-down lists known as combo boxes . In this case, you can select an itemfrom the list by clicking on the drop-down arrow or you can type in your entry and Access will offer tocomplete the entry for you. In some cases the field may be set up to restrict data entry to the drop-down list, in which case you must choose one of the entries on the list.

    Required fields The property for a field may be set to be required , in which case the field cannot be left blank.

  • 7/31/2019 Access Using 2010 Manual

    16/28

    Data selection and editing 12 UCL Information Systems

    Data selection and editingSelecting data in tables

    Areas that have been selected are highlighted in yellow. Once an area has been selected it can be edited

    or deleted as described in the next sections.Selecting records

    To select a single record click on its Record Selection button (see below)

    To select multiple adjacent records, click and drag the pointer down across the record selectors asrequired ( see below ).

    To select all records, click on the Table Selector button at the top left corner of the table (see above).

    Selecting a cellPosition the pointer at the start of the field and, when the pointer is shaped like a white cross, click withthe mouse.Notice that the complete cell, not just the cell contents, is selected.

    Selecting data in formsSelecting records can be done using the Select drop-down on the Home tab.

    To select a record: From the Select drop-down list choose Select All . If it is visible, click on the Record Selector button at the left-hand side of the

    form (see Record selector symbols section).

    To select all records:

    From the Select drop-down list choose Select All . Editing data

    This section covers making changes to existing data in a table or form. When completing the following section, refer to the section on Data navigation , particularly Navigation and Editing modes (page 8).

    Part of a field To replace part of the contents of a field:

    1. Navigate to the field using any method.

    2. If you are in Navigation mode (i.e. the contents of the field is selected):Switch to Edit mode by pressing the F2 key.

    Table selectorbutton

    Record selectorbutton

  • 7/31/2019 Access Using 2010 Manual

    17/28

    UCL Information Systems 13 Data selection and editing

    3. Navigate to the part of the cell you wish to modify and modify the data using the keyboard asdetailed below:

    Keys to move/edit data within a field in EditmodeDelete

    Backspace /

    Remove one character to the right.

    Remove one character to the left.Move one character left/right.

    Ctrl + Move one word to the left.

    Ctrl + Move one word to the right.

    End Move to the end of the line.Home Move to the beginning of the line.

    Entire field

    To replace the entire contents of a field:1. Navigate to the field using any method except the mouse.

    The contents of the field will be selected.

    2. Type to replace all existing data in the field.Helpful hint:If you use the mouse to click in the field, the cursor will be displayed (Edit mode). Press F2 to select thecontents (Navigation mode).

    Copying and moving data

    Single field or part of a field You can copy and paste all or part of the contents of a field just as you would in any other MicrosoftOffice application:

    1. Click and drag the mouse across the text to select all or part of a field.

    2. If you are in Navigation mode the entire contents of the field will already be selected.

    3. On the Home tab select Copy to copy data or Cut to move data.

    4. To insert the text, move the cursor to a new position, or to replace existing text, select any text you wish to replace.

    5. On the Home tab select Paste .

    Copying an entire cell1. Select the entire cell (see Selecting a cell on page 11).

    2. Select Copy to copy the cell.

    3. Select another cell.

    4. Select Paste .Helpful hint:It is not possible to Cut and Paste an entire cell.

  • 7/31/2019 Access Using 2010 Manual

    18/28

    Data selection and editing 14 UCL Information Systems

    Whole record(s) You can copy and paste one record or multiple records, either to append as new records in your tableor to replace existing records.

    1. Select the required record(s) (see Selecting data in tables section for more details).

    2. Select Copy to copy the record(s).

    3. To replace existing records, select the records you wish to replace, or to append the record, click onthe New Record selector.

    4. Select Paste.

    Helpful hint:

    When replacing multiple records, there must be the same number of records in the copied selection and therecords being replaced.

    Deleting records1. Select the required records.

    2. On the Home tab select Delete or use the Delete key on the keyboard.

    3. Click on the Yes button in the dialog box which appears to confirm the deletion.Helpful hint:

    Once you have deleted a record or group of records, you will not be able to retrieve it. For this reasonAccess displays a warning message when you delete records.

    Using the undo facility

    Access provides the facility to undo the last change made to the data. The command may vary according to the change just made e.g. Undo Typing , Undo Current Field , Undo Current Record , Undo Saved Record . Note that for some operations (deleting records is one example), the Undo facility is notavailable. However Access will warn you if what you are about to do is irreversible.

    From the Quick Access Toolbar (top left of the Access window) select Undo or use the keyboardshortcut CTRL + Z.

  • 7/31/2019 Access Using 2010 Manual

    19/28

    UCL Information Systems 15 Customising datasheets

    Customising datasheetsChanging the appearance of a datasheet

    You can change the appearance of a table in Datasheet view to make it easier to read and to distinguishone table from another. These are available in the Text Formatting part of the Home tab.

    Re-organising fields

    There are a number of ways to reorganise data to make records easier to view. This section coverscustomising the layout of a table and sorting records.

    You can move fields, adjust field width and row height, and freeze or hide field display in the Datasheet view. You may also sort the contents of two or more adjacent fields.

    Selecting a field or fields To select a single field (as shown below), click on the Field Selector (the top of the column containing theheading) .

    To select multiple fields, click on the first fields field selector and, without releasing the mouse button,drag the pointer across the field selectors of the other fields required.

    Helpful hint: only adjacent fields can be selected simultaneously.

    Moving fields1. Select the field or fields you wish to move.

    2. Click and drag left or right to the new position. A bold vertical bar appears to show the position of the field as you drag.

    3. Release the mouse button when the vertical bar is in the position you require for the field.

    Turn gridlines on and off

    Colour alternate rows (selectNo colour to use backgroundcolour for all rows)

    Click here for more options

  • 7/31/2019 Access Using 2010 Manual

    20/28

    Customising datasheets 16 UCL Information Systems

    More field and row options You can change the appearance of fields and rows and subdatasheets using the More button on theRecords part of the Home tab.

    Changing field width or row heightFit to a specific width/height:Navigate to any cell in the field or row to be changed or select the fields to be changed.Click on the More button on the Records part of the Home tab.Note that changes to row height affect all rows.

    Click and drag to new width/height:1. Position the pointer in the border to the right of the field to be changed (or in the lower border of

    the row to change the row height). The pointer changes shape to a double headed arrow.

    2. Click and hold down the left mouse button, drag the pointer to the height or width required andrelease the mouse button.

    Field width best fit:1. Position the pointer on the right border of the field heading, as above.

    2. Double-click the left mouse button. The width will be set automatically to fit the widest cell entry currently visible on screen.

    Please note, that no best fit method is available for row height.

    Freezing and unfreezing fieldsIn a large table when all fields cannot be viewed on the screen at one time it is possible to freeze fieldsso as to prevent them from scrolling off the screen.

    Freezing fields 1. Select the fields to be frozen.

    2. Click on the More button on the Records part of the Home tab.

    3. Select Freeze Fields . The frozen fields will automatically be moved to the far left of the table.

    If no fields are selected when you select this command, Access freezes the field containing the insertionpoint.

    Change the behaviour of thesubdatasheet

    Changes the row height forall rows in the table

  • 7/31/2019 Access Using 2010 Manual

    21/28

    UCL Information Systems 17 Customising datasheets

    Helpful hint: To move a field which has been frozen it must be unfrozen first.

    Unfreezing fields Click on the More button on the Home tab and select Unfreeze All Fields .

    Hiding or showing fieldsIt is also useful to be able to hide fields, to make it easier to focus onthe fields (fields) of particular interest.

    Hiding a field 1. Select the field(s) to be hidden.

    2. Click on the More button on the Home tab and select HideFields .

    Showing hidden fields

    1. Click on the More button and select Unhide Fields. 2. Tick in the fields boxes to be unhidden (displayed) as shown left.

    Adding Totals to a datasheet Totals enable you to count the number of records in a table and perform other aggregate functions suchas finding the sum of values in a column or the minimum , maximum or average value in a column.

    To add Totals:

    1. Click on the Totals button in the Records group on the Home tab. A new row will appear below the new record row of your datasheet. The word Total will appear inthe first column in the new row.

    2. Use the drop down arrows in the Total row to add specific aggregate functions to a particular field. The aggregate functions available will depend on the data in the column. For example, columnscontaining text can only use a Count function.

    The screen capture below shows Totals on the Product table where a count has been added to theProduct Name field and the drop-down options are displayed for the Unit Price field.

  • 7/31/2019 Access Using 2010 Manual

    22/28

    Customising datasheets 18 UCL Information Systems

    The Total row is not is not considered to be one of the records and is therefore not included whenrecords are sorted.

    If you apply a filter to your records, the result of the functions will reflect the filtered data. So, forexample, if you add an Average function to the Unit Price column and then filter products to only show Beverages then the Total row will display the average price of Beverages only.

    Sorting recordsSorting records in a tableIn a datasheet you can sort by just one field or by two or more adjacent fields in a single action. Accessalways sorts records starting with the left-most field.

    1. If necessary move a field or fields so that they are in the correct sort order (left to right).

    2. Select the field or fields you wish to sort on.

    3. Select either Ascending or Descending

    Example The example below shows the Customers Table sorted first by Contact Title ( Primary Sort) and then by Company name ( Secondary sort) in ascending order. Customers are sorted alphabetically by Contact Title sothat all customers with the same contact title appear together. Within each set of records with the samecontact title, records are sorted by company name.Helpful hint: The Contact Title field has been moved so that it is to the immediate left of the CompanyName field.

    Sorting records in a FormIn a Form you can sort by one field only:

    1. Click in the field you want to sort by in any record.

    2. Select either Sort Ascending or Descending

    Saving the datasheet layout When you close a table you are prompted to save the layout. Saying yes will save any changes using thefeatures described in this section (Customising datasheets) will be saved for the next time you open thetable.

  • 7/31/2019 Access Using 2010 Manual

    23/28

    UCL Information Systems 19 Locating data

    Locating dataIn a small database, data may easily be located by navigation, but in a larger database a search method isrequired. Access provides two methods for finding data in Tables and Forms:

    Search: to quickly find a specific string of text Find : used to locate a record that matches certain values

    Filters : used to extract temporarily records matching specified criteria

    Search This feature allows you to quickly find specific data.

    1. Click in the Search box to the right of the Navigation bar .

    2. Type the text you wish to find.

    The first instance of this text in the table will be highlighted.3. Press Enter to move to the next instance.

    4. Keep pressing Enter to jump to further instances of the text.

    Find and Replace

    Locating data using Find1. Click on the Find button on the Home tab .

    The Find dialog box will be displayed:

    2. Type what you are looking for in the Find What box (see below).3. Click on the Find Next button.

    4. Repeat the step above to scroll through all matching records.

    Other options in the Find dialog box Look In: Allows you to specify which part of the database to search (select the field name to search thefield or the table or form name to search all records).

    Match: Allows you to specify whether to match Whole Field (the entire contents of the Find What box must exactly match the entire contents of the field) or Any Part of Field (contents of the FindWhat box must exactly match any part of the field) or Start of Field (the contents of the Find Whatbox must exactly match the beginning of the field).Match Case: Tick this to find only records where upper and lower case letters match corresponding letters in your Find What box.

  • 7/31/2019 Access Using 2010 Manual

    24/28

    Locating data 20 UCL Information Systems

    Search : Specify whether to search Up (records previous to the current record), Down (recordsfollowing the current record) or All.

    Replacing field contentsIt is possible not only to search for your data but also to replace that data with an alternative. Thisallows changes to be made quickly and easily.

    1. Click on the Replace button on the Home tab. The Replace dialog box will be displayed (see below). Notice the similarities with theFind dialog box.

    2. Complete the dialog box as for the Find dialog box (see previous page) to specify the text you wishto find.

    3. Enter the new text (with which to replace the text in the Find What box) in the Replace With box.

    4. To replace specific instances of the search term:

    Use the Find Next button to scroll through your records. For each item you wish to change, click on Replace .

    To replace all instances of the search term: Click on Replace All.

    Helpful hint:

    Use the Replace All command with extreme caution. You cannot undo the Replace All command .

  • 7/31/2019 Access Using 2010 Manual

    25/28

    UCL Information Systems 21 Locating data

    Filtering records in a table or formFilters and queries are tools that can be used to create a custom view of your data that includes orexcludes records according to specific criteria. A Filter can be used to temporarily change the set of records you are viewing while a table or form is open. Filters are temporary and are not saved with thetable or form.

    Unlike the Find function, which only operates on one criterion, Filters enable you to generate lists of records based on several criteria in one or several fields.

    All the Filter commands are available in the Sort and Filter group on the Home tab.

    Filter by selection

    This Filter displays only those records that have a specific value in a particular field.1. Select all or part of the text in a specific cell.

    2. Click on the Selection drop-down list. Different options are displayeddepending on what type of data is selected. These options allow you match orpartially match text or match a specific number or date or a range of numbers and dates.

    3. Select an option. Only records which meet the criteria you specified will be displayed and all otherrecords will be hidden.

    When records are filtered, a symbol appears indicating which field(s) contains the filter criteria and afilter symbol and the word Filtered appears to the right of the Navigation bar.

    Text field example Select the word Sales in a cell in the Contact Title field of the Customers table and choose ContainsSales from the Selection drop-down list. Only records with the word Sales in the Contact Title field

    will be displayed.

    Date field example Select a date in the Order Date field in the Orders table and choose On or Before from the Selection drop-down list. Orders placed on or before the selected date will be displayed.

    Filter by formHere you enter criteria in the required fields to filter data in several fields.

    1. Click on the Advanced drop-down list and select Filter By Form .

    2. A datasheet (when filtering a table) or form (when filtering a form) will appear with a Look For tabat the bottom.

  • 7/31/2019 Access Using 2010 Manual

    26/28

    Locating data 22 UCL Information Systems

    3. The filter form will usually display the most recent criteria entered. To ensure that all previouscriteria have been cleared before creating a new filter, select Clear Grid from the Advanced drop-down list.

    4. Type any criteria you want to match in the relevant fields. Typing criteria in more than one field will mean that records will have to match all the criteria you enter.

    5. To add alternative criteria that the records could match, click on the Or tab at the bottom of theform or datasheet. A second form or datasheet will appear for you to enter additional criteria.

    6. From the Advanced drop-down list select Apply Filter/Sort or click on the Toggle Filter button.

    The records that match the criteria you have specified will be displayed.

    Example 1. Click on object forms and open the form Customers .

    2. Select Filter By Form from the Advanced drop-down list.

    3. Type Sales Representative in the title field and Germany in the country field (see the screen capture

    above).4. Click on the Or tab and type UK in the country field.

    5. Select Apply Filter/Sort from the Advanced drop-down list.

    This Filter will display sales representatives from Germany and all customers from the UK.

    Helpful hint:Access automatically places double quote marks around criteria in a text field and hash marks ## aroundcriteria in a date/time field. For more information about using criteria, see Criteria on page 22.

    Toggle FilterClick on the Toggle Filter button to apply/remove the most recent filter criteria you have created .

  • 7/31/2019 Access Using 2010 Manual

    27/28

    UCL Information Systems 23

    CriteriaGiven below are a range of some of the possible criteria that can be used in queries and filters. This isby no means an exhaustive list see Access Helpfor more information.

    Note that in certain fields it is only possible to define criteria matching the data type in that field. Forexample, it is only possible to specify a particular date or range of dates in a date field and to specify aparticular number or range of numbers in a number field. Access will warn you if you attempt to enteran inappropriate criterion in a field.

    Dates and numbers To find records matching a specific date or number or a range of dates or numbers:

    To find: Type: Example Displays:

    Exact match [date or number] 14/02/03 14/02/03

    Greater than >[date or number] >100 101 and up

    Less than =14/02/03 after and including 14/10/03

    Less than orequal to

  • 7/31/2019 Access Using 2010 Manual

    28/28

    Exclusion To find fields which dont match certain criteria add Not to the front of the criteria.

    This can be used for text, dates or numbers.

    Examples Not *Manager* : Finds records fo r which a field doesnt contain Manager anywhere in the field.

    Not 14/10/03: Finds records for which a field doesnt exactly match the date 14/10/03.

    Acceptable syntax Access automatically places double quote marks around text and hash # symbols around datesentered in the criteria line, but numbers are not changed. Access will also add the word Like to any expressions including an asterisk *. To save time when creating queries it is more usual to leave outthese symbols and allow Access to add them.

    To ensure that Access recognises dates correctly, they should always be written in an acceptable format. Access recognises dates in a number of formats but it is recommended to use dd/mm/yy (e.g.25/12/03) or dd/mm/yyyy (e.g. 25/12/1795) as standard.


Recommended