creating tables in ms-access

Upload: immortal-dyke

Post on 06-Apr-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/2/2019 Creating Tables in MS-Access

    1/18

    CREATING TABLESIN

    MS-ACCESSBCA20 BA, BB, BD, ACC

    Florence B. Reyes

  • 8/2/2019 Creating Tables in MS-Access

    2/18

    OBJECTIVE:

    Students are expected to be familiar with MS-Access environment.

    Build a table by entering field names and

    setting data types.

    Create table using the Datasheet View, Table

    Templates, and Design View.

    Update table values using a lookup field a

    field that contains a list of choices.Create a relationship.

    Can successfully create simple tables.

  • 8/2/2019 Creating Tables in MS-Access

    3/18

    HOWTO START CREATINGADATABASE?

    Open MS-Access application by clicking>Start Menu >All Programs >Microsoft

    Office>MSAccess

    You start by creating a new, blank database

    Assign a File Name: CreatingTables_FamilyName

    then click create

    Clickon the BlankDatabase

    1.

    2.

    3.

    Type the desired file name

    Click Create button

  • 8/2/2019 Creating Tables in MS-Access

    4/18

    HOWTO CREATEATABLEUSING DATASHEET VIEW?

    The new table opens automatically in Datasheet view.

    Notice how the new table contains a field called ID.

    That's your primary key, simply DOUBLE-CLICK thefirst field header and enter the primary key, then press

    ENTER.

    4.

    4.

  • 8/2/2019 Creating Tables in MS-Access

    5/18

    HOWTO CREATEATABLEUSING DATASHEET VIEW?

    Go to the next blank field and enter a name in thatheader. Repeat the process until you've entered namesfor all your fields but with a couple exceptions: don'tadd any lookup fields, and don't add foreign keyfields.

    5.

    5.

  • 8/2/2019 Creating Tables in MS-Access

    6/18

    HOWTO CREATEATABLEUSING DATASHEET VIEW?

    When you've finished, go to the Quick Access Toolbarand click Save.

    In the Save As dialog box, enter the name for the

    table and click OK.

    6.

    6.

    7. Customer

    7.

  • 8/2/2019 Creating Tables in MS-Access

    7/18

    HOWTOSET DATATYPE?

    After you enter field names, you'll need to set the datatype for each field.

    Select the field that needs a data type. Just click the

    field header.

    If it isn't already selected, click the Datasheet tab.In the Data Type & Formatting group, open

    the Data Type list and select an option.

    1.

    2.

    3.

    1.

    2.

    3.

  • 8/2/2019 Creating Tables in MS-Access

    8/18

    HOWTOUSETHE TABLE TEMPLATES?

    The templates capture data for common business needs,

    and all the fields and data types are set up for you.

    Click the Create tab.

    In the Tables group, click Table Templates, and thenclick the template you want to use.

    You can use the template right away just start enteringdata or you can add, remove, or change the fields.

    Just make sure you save the table and give it a descriptivename.

    1.

    2.

    1.

    2.

  • 8/2/2019 Creating Tables in MS-Access

    9/18

    HOWTO CREATE TABLEUSING DESIGN

    VIEW? Design view allows you to build a table from scratch and set

    or change every available property for each field.

    You can also open existing tables in Design view and add,

    remove, or change fields.

    On the Create tab, in the Tables group, click Table

    Design.

    4.

    3.

    1.

    2.

    1.

  • 8/2/2019 Creating Tables in MS-Access

    10/18

    HOWTO CREATE TABLEUSING DESIGN

    VIEW?

    In the Field Name column of the designer, enter the

    names of your table fields. As a rule, the first field you

    create should be yourprimary key field. And rememberthat you don't need to add any foreign key fields now.

    You can do that when you create your relationships.

    4.

    3.

    1.

    2.

    2.

  • 8/2/2019 Creating Tables in MS-Access

    11/18

    HOWTO CREATE TABLEUSING DESIGN

    VIEW?

    In the Data Type column, use the list next to a fieldname to choose a data type for that field.

    Optionally, use the Field Properties pane to set

    properties for individual fields. For example, you canuse the pane to change the values in a lookup field.

    Dont forget to save changes and give your new table aname that describes the data it contains

    4.

    3.

    1.

    2.

    4.

    3.

  • 8/2/2019 Creating Tables in MS-Access

    12/18

    HOWTOUSETHE LOOKUP?

    Lookup fields can store a list of options internally, or

    they can look up data from fields in other tables.

    ROW SOURCE TYPE: TABLE/QUERY

    Make sure that the table/query already exist for the

    Lookup column.

    Switch your table to

    Datasheet view.

    Click the Datasheet tab, and

    in the Fields

    & Columns group,

    clickLookup Column

    to start the Lookup Wizard.1.

    2.

    On the first page of the wizard, clickI want to

    lookup column to look up the values in a

    table or query. and clickNext.

    3.

  • 8/2/2019 Creating Tables in MS-Access

    13/18

    HOWTOUSETHE LOOKUP?

    On the next page of the wizard,

    select the table that contains the

    field needed for your look up and

    clicknext.

    4.

    5.

    The third page of the wizard, select the field(s)

    from the Available Fields: and click the arrow

    to the right so that the field(s) will be in the

    Selected Fields: and clicknext.

    Fourth page of the wizard will ask you whatsort order you want for the List Box.

    6.

    Fifth page of the wizard will allow you to

    adjust the columns for the look up field.

    7.

    On the last page, enter a name for the

    new field and clickFinish.

    8.

  • 8/2/2019 Creating Tables in MS-Access

    14/18

    HOWTOUSETHE LOOKUP?

    1.

    2.

    3.

    4.

    5.

    3. On the first page of the wizard, clickI will type in the values that I want and

    clickNext.

    On the next page of the wizard, make sure the Number of columns boxcontains a 1 and then enter your options in the grid, one option per row.

    On the third page of the wizard, enter a name for the new field and clickFinish.

    4.

    5.

  • 8/2/2019 Creating Tables in MS-Access

    15/18

    HOWTOUSETHE LOOKUP?

    ROW SOURCE TYPE:VALUE LIST

    Switch your table to Datasheet view. You can do that by right-clicking the tab for

    the table and clicking Datasheet view.

    Click the Datasheet tab, and in the Fields & Columns group, clickLookup

    Column to start the Lookup Wizard.

    1.

    2.

    3.

    4.

    5.

    1.

    2.

  • 8/2/2019 Creating Tables in MS-Access

    16/18

    HOWTOCREATEARELATIONSHIP?

    Click the Datasheet tab. In the groupRelationships select the Realtionships.

    1.

    On the Design tab click on the

    Show Table.

    2.

    Add all the table at ones.3.Select the line that connects the

    table and right click, select Edit

    Relationship

    4.

  • 8/2/2019 Creating Tables in MS-Access

    17/18

    HOWTOCREATEARELATIONSHIP?

    In the Edit Relationships dialog

    box, check the three (3) check

    boxes and click on OK.

    Congratulations! you have a

    one-to-many relationship.

    5.

  • 8/2/2019 Creating Tables in MS-Access

    18/18

    YOUCANSTARTYOUR ACTIVITY 1 Good Luck!