Tiwari Kings 2

download Tiwari Kings 2

of 28

Transcript of Tiwari Kings 2

  • 8/11/2019 Tiwari Kings 2

    1/28

    Introduction to Tables

    Imagine you create a list of people. The list can be started

    with names as follows: Bill, James, Hermine, and Khan.This type of list is considered one-dimensional because allof its items fit in one category. In order to create a moredetailed list, you may want to include these peoples emailaddresses and probably other related information. If youinclude these additional pieces of information in the samecategory, the list may become confusing. To arrange the

    list, you would di!ide it in categories. Here is an e"ample:Name Email Address

    Phone

    Number Relationship

    Bill bill#yahoo.com $riend

    James %amesemail.com&'()*+-)+

    Hermine&'('* /-+

    0ousin

    Khan #Khan.com

    This type of display allows you to refer to a piece ofinformation by its category. This is the basis of a table. 1table is a two-dimensional list of items so that the items arearranged by categories. 1 complete or incomplete series ofitems that represent each category is called a record.Therefore, a table can be represented as follows:

  • 8/11/2019 Tiwari Kings 2

    2/28

    In database de!elopment, a category is represented as acolumn. 2ometimes it is also called a field. 1 record isrepresented as a row.

    http://functionx.com/access/Lesson02.htmhttp://functionx.com/access/Lesson02.htm
  • 8/11/2019 Tiwari Kings 2

    3/28

    Database Objectand Fields

    1 field is an ob%ect used to host, hold, or store a piece ofinformation of a database. Before such an ob%ect canperform its function, it must first be created. In the strictsense, the most important or the most regularly used fieldsof a database are created on a table, but tables may not bethe friendliest windows to present to a user for data entry.$or this reason, fields can and should also be created on

    other windows.The process of ma3ing a field a!ailable depends on the typeof ob%ect it will reside on and probably how the field willbe used. This leads to two categories of fields: those thatcan recei!e or store information and those that can onlypresent or display it. 1ll fields of a table, especially in4icrosoft 1ccess, are created to store data.

    http://functionx.com/access/Lesson02.htmhttp://functionx.com/access/Lesson02.htmhttp://functionx.com/access/Lesson02.htmhttp://functionx.com/access/Lesson02.htm
  • 8/11/2019 Tiwari Kings 2

    4/28

    TABLE LAYOUT

    The Table's Tab

    1 table is presented as a rectangular window represented inthe middle of the screen with a tab. 1s an option, you canremo!e the tabs and let the tables displaywithout them. Todo this, you can clic3 $ile and clic3 5ptions. In the leftframe, clic3 0urrent 6atabase and, in the right frame, in the

    6ocument 7indow 5ptions section, clic3 the Tabbed6ocuments radio button and remo!e the chec3 mar3 on the6isplay 6ocument Tabs chec3 bo":

    http://functionx.com/access/Lesson02.htmhttp://functionx.com/access/Lesson02.htm
  • 8/11/2019 Tiwari Kings 2

    5/28

  • 8/11/2019 Tiwari Kings 2

    6/28

    In 4icrosoft 5ffice 1ccess )('(, by default, a table in6atasheet 9iew is represented with a tab, which pre!ents

    the user from mo!ing it around. If you want, you can ma3ethe tables of a database appear as single documents. To dothis, open the 1ccess 5ptions dialog bo" from the $ilecategory. In the left frame, clic3 0urrent 6atabase. nder6ocument 7indow 5ptions in the right frame, clic3 the5!erlapping 7indows radio button:

    7hen you clic3 5K, you will be as3ed to close and reopenthe database &which you should do*.

    A Table as a Datasheet

  • 8/11/2019 Tiwari Kings 2

    7/28

    1lthough a table is primarily recogni;ed as an arranged listof columns and rows, each column and each row intersectto create a rectangular bo" called a cell:

    The cell is actually the ob%ect that holds data of a table. 1cell holds only one piece of information. The databasede!eloperdecides what type of information would go into acell but the user types that information. Based on itsarrangement of cells, a table is said to display in a datasheet

    layout or simply a datasheet &because its !iew is made ofcells*.

    Table Navigation Buttons

    http://functionx.com/access/Lesson02.htmhttp://functionx.com/access/Lesson02.htmhttp://functionx.com/access/Lesson02.htmhttp://functionx.com/access/Lesson02.htm
  • 8/11/2019 Tiwari Kings 2

    8/28

    The lower left side of the table is made of four buttons usedto na!igate the table, one button used to create a newrecord, and a te"t bo". re!ious =ecord1llows you to mo!e one record bac3 &ifthere is one* from the current record

    0urrent =ecord6isplays the number representing thecurrent record out of the total number ofrecords

    ?e"t =ecord 1llows mo!ing you one record ahead

    @ast =ecord1llows mo!ing you to the last record ofthe table

    ?ew &Blan3*=ecord

    sed to enter a new record on the table

    Introduction to Table Creation

    Table Creation

    http://functionx.com/access/Lesson02.htmhttp://functionx.com/access/Lesson02.htmhttp://functionx.com/access/Lesson02.htmhttp://functionx.com/access/Lesson02.htm
  • 8/11/2019 Tiwari Kings 2

    9/28

    To ha!e a table as part of your database, you must create it.8ou ha!e !arious options. If you create a database usingone of the local templates, it would pro!ide you with a few

    tables that you can start using. 5therwise, to create a table,on the =ibbon, you can clic3 0reate. In the Tables section,clic3 Table. This would cause the =ibbon to switch to asection labeled $ields:

    $rom the $ields tab, you can ma3e selections.

    The Name of a Table

    @i3e e!erything that is part of a database, a table must ha!ea name that can be used to refer to that ob%ect throughoutthe database and in other files that can be lin3ed to the

  • 8/11/2019 Tiwari Kings 2

    10/28

    table. There are two main ways you can specify the nameof a table, either when you sa!e it for the first time or if youdecide to rename it.

    To sa!e a table you ha!e %ust created:

    8ou can clic3 $ile and clic3 2a!e 8ou can right-clic3 the TableA &such as Table'* tab

    and clic3 2a!e 8ou can press 0trl C 2 8ou can start closing the table. 8ou would be

    prompted to sa!e the change &if its structure has beenchanged from the structure it had before it wasopened*

    Table anagement

  • 8/11/2019 Tiwari Kings 2

    11/28

    The Tables in the Navigation !ane

    Because the table is the primary ob%ect of a database, whenyou create a table and sa!e it by gi!ing it a name, 4icrosoft1ccess creates a section labeled Tables in the ?a!igation>ane and displays the name of thew new table in thatsection. In the same way, you can ha!e as many tables aspossible in the Tables section. Here is an e"ample:

    1s we will see in the ne"t lesson, you can create otherob%ect and they will ha!e their sections.

  • 8/11/2019 Tiwari Kings 2

    12/28

    The most regular operations you will perform on a tablereDuire that you open it first. To open a table, first locate itin the ?a!igation >ane then:

    8ou can double-clic3 the table 8ou can right-clic3 the table and clic3 5pen

    1ny of these actions causes the table to display in6atasheet 9iew in the central area of the screen. In thesame way, you can open as many tables as necessary.

    Closing a Table

  • 8/11/2019 Tiwari Kings 2

    13/28

    1fter using a table, you can close it. Before closing a table,first select its tab. Then, to close a table:

    8ou can clic3 the close button on the right side ofthe tabs

    8ou can press 0trl C 2hift C $

    Selecting a Table

  • 8/11/2019 Tiwari Kings 2

    14/28

    In order to use a table, some operations reDuire that you &orrather the user* first select&s* it:

    To select a table in the ?a!igation >ane, simply clic3

    it If you had opened many tables and they are displaying

    in the main area of the screen, to select one, clic3 itstab or its title bar

    If you ha!e many tables displaying in the main area ofthe screen, you can press 0trl C $E continuously toswitch from one table to the ne"t until the desired one

    displays

    #enaming a Table

    7e saw that, when or after creating a table, you must sa!eit to ma3e it part of your database. 7hen sa!ing it for the

    first time, you must gi!e it a name. If the name of a table isnot appropriate, you can change it. To rename a table, in the?a!igation >ane, you can right-clic3 the name of the tableand clic3 =ename.

    Deleting a Table

    If you ha!e a table you dont need anymore, you canremo!e it from your database. Because you cannot delete atable if it is opened, you must first close it.

    To remo!e a table from your database:

  • 8/11/2019 Tiwari Kings 2

    15/28

    In the ?a!igation >ane, right-clic3 the table and clic36elete

    In the ?a!igation >ane, clic3 the table to select it.

    Then, on the =ibbon, clic3 Home. In the =ecordsection, clic3 6elete In the ?a!igation >ane, clic3 the table to select it and

    press 6elete

    In each case, you will recei!e a warning to confirm whatyou want to do. It is important to 3now that if you delete atable, because it is not a file, it does not go into the =ecycle

    Bin: it is lost, including its records. Therefore, beforedeleting a table, ma3e sure you really want to get rid of it.7hen in doubt, do not delete it.

  • 8/11/2019 Tiwari Kings 2

    16/28

    Tables Columns in the Datasheet $ie%

    0reating a 0olumn

    1lthough we did not mention it so far, a table does not e"istwithout a column. >ut it another way, a table must ha!e atleast one column in order to ha!e meaning. This also means

    that, in order to create a table, it must actually ha!e at leastone column. If you start a table in 6atasheet 9iew,4icrosoft 1ccess creates and gi!es it one default column.5nce a table displays in 6atasheet 9iew, you can startentering data into its cells. If you do this, whene!er youenter data under a column, that column recei!es anincremental name: the first column on the right side of I6

    would be named $ield', the second would be $ield), and soon. These would be insignificant and can e!en beconfusing. $ortunately, you can gi!e meaningful names tothe columns of your table.

    Naming a Column

    1 column can ha!e almost any name: FBoo3 TitleF,F6G#HF, FThis Is The Boo3 TitleF, F=67F, etc.2ome columns will ha!e only tinny data, li3e a personsage, the number of boo3s in an office, a persons middle

  • 8/11/2019 Tiwari Kings 2

    17/28

    initial, etc. It may not be a good idea to gi!e them a namethat would ta3e too much space.

    To name a field, first figure out what the data in the

    category will be made of. If you are planning to enteremployees salaries in a field, you can %ust call it 2alary. Ifyou want to specify employeess names by first name,middle name, and last name, you can use such columnnames and ma3e them distinct. In this case, you could namethe first column as first name, the last name would becalled last name. 1lthough you can use one word names,

    some people might be confused. The suggestion is todistinguish where!er a new

  • 8/11/2019 Tiwari Kings 2

    18/28

    &sing a Sam"le Field

    7hen you start a table in the 6atasheet 9iew, the =ibbonbecomes eDuipped with a new tab labeled $ields. Thesample fields and their configurations are distributed in!arious sections. 5ne of the sections of the $ields tab isnamed 1dd 6elete:

    4icrosoft 1ccess pro!ides many pre-configured fields youcan add to your table. These ready-made sample columnsare referred to as a $ield Templates. To use a field template,while the table is displaying in 6atasheet 9iew:

    0lic3 or right-clic3 the header of a column. Thiswould bring a menu from where you can select anoption

  • 8/11/2019 Tiwari Kings 2

    19/28

    5n the table, clic3 the header column or a cell underthe column. In the 1dd 6elete section of the $ieldstab of the =ibbon, clic3 the type of field you want

    In the 1dd 6elete section of the =ibbon, clic3 4ore$ields to display a list and clic3 an option from thatmenu

  • 8/11/2019 Tiwari Kings 2

    20/28

  • 8/11/2019 Tiwari Kings 2

    21/28

    Columns aintenance in theDatasheet $ie%

    Im"orting a Table and its Columns

    1lthough a column completely depends on a table, bothob%ects are closely related when it comes to theirmaintenance. In other words, the maintenance performed

    on one ob%ect can directly affect the other. $or e"ample,you can import a table from a te"t file or from anotherapplication. 1 table cannot e"ist without at least onecolumn.

    2electing a 0olumn

    2ome operations will reDuire that you select a column but itdepends on the operation you want to perform. In somecases, when any cell under a column has focus &fore"ample if the caret is blin3ing in a cell of a column*, thecolumn is considered to be selected. 5therwise:

    To select one column, position the mouse on its name

    until the cursor points down and then clic3

  • 8/11/2019 Tiwari Kings 2

    22/28

    To select columns in a range, clic3 and hold yourmouse on one of them, then drag to the left or to theright to co!er the other desired column or columns.7hen all desired columns are highlighted, release themouse

    To select a range of columns, clic3 one column thatwill be at one end, press and hold 2hift, then clic3 thecolumn that will be at the other end, and release 2hift

    0hanging the 7idth of a 0olumn

    If you create a table using one of the Table Templates or ifyou get a table from a 6atabase Template, the columns ofthe tables are wide enough to show their names. If youcreate a table from scratch in the 6atasheet 9iew, 4icrosoft1ccess assigns it a default width. That width can appear tobe too narrow or too wide. $or e"ample, when data e"ceedsthe regular width of a column, part of the informationwould be hidden. If a particular column contains data that

    you want to display at all times, you can enlarge thecolumn. 5n the other hand, if a column displays tinnypieces of information, you can narrow the column to let it%ust fit the data as desired. There are !arious techniDues youcan follow to widen or narrow a column.

  • 8/11/2019 Tiwari Kings 2

    23/28

    To change the width of a column:

    you can position the mouse on the right border of acolumn header. The mouse pointer would change into

    a hori;ontal double arrow crossed by a !ertical line:

    If you double-clic3, the column would be resi;ed tothe widest !alue of the column, pro!ided the widest!alue is wider than the column header. If the widest!alue is narrower than the column header, the columnwidth would be widened enough to display the nameof the column.

    8ou can clic3 the columns right border and drag in the

    desired direction, left or right until you get the desiredwidth

    8ou can right-clic3 a columns name and clic3 0olumn7idth... This would open the 0olumn 7idth dialogbo" where you can type the desired !alue and clic35K

  • 8/11/2019 Tiwari Kings 2

    24/28

    oving a Column

    If you find out that a particular column is misplaced in a

    table, you can change its position.

    To mo!e a column in 6atasheet 9iew, first select it. 0lic3and hold your mouse on it. Then, start dragging left or rightin the desired direction. 7hile your mouse is mo!ing, athic3 !ertical line will guide you. 5nce the !ertical line ispositioned to the desired location, release the mouse:

    To mo!e a group of columns, first select them as we

    re!iewed earlier. 0lic3 and hold the mouse on one of theselected columns. 2tart dragging left or right in the desireddirection until the thic3 !ertical guiding line is positionedin the desired location, then release the mouse:

  • 8/11/2019 Tiwari Kings 2

    25/28

    Inserting a Column

    Inserting a column consists of adding one between twoe"isting fields. To do this, right-clic3 the column that willsucceed it and clic3 Insert $ield

    'iding and #evealing a 'idden Column

    If a table contains many columns and at one time you thin3

    you dont need all of them, you can hide some. To hide acolumn, you can drag the right border of its column headercompletely to its left border as we saw earlier to change thewidth of a columnL when the !ertical guiding line reachesthe left border, release the mouse: the column would behidden from the table:

  • 8/11/2019 Tiwari Kings 2

    26/28

    To hide one or a group of columns, you can right-clic3 and

    clic3 Hide $ields. 8ou can also right-clic3 any column andclic3 nhide $ields. This would open the nhide 0olumnsdialog bo". Here is an e"ample:

    To hide a column, clear its chec3 bo".

    To re!eal a column or a group of columns pre!iouslyhidden, right-clic3 any column header on the table andclic3 nhide 0olumn. In the nhide 0olumns dialog bo",put a chec3 mar3 on each column you want to show.

  • 8/11/2019 Tiwari Kings 2

    27/28

    Deleting a Column

    If you ha!e an undesirable column in a table, you candelete it. It is important to 3eep in mind that if you delete acolumn, it also goes with any information under it.

    To remo!e a column from a table:

    =ight-clic3 the columns name and clic3 6elete $ield 2elect the column &or a group of columns*, right-clic3

    anywhere in the table and clic3 6elete $ield 2elect a column &or a group of columns*. Then, in the

    1dd 6elete section of the =ibbon, clic3 the 6eletebutton

    1ny of these actions would present you a warning toconfirm whether you still want to delete the column&s* oryou want to change your mind. If you still want to remo!e

    the column&s*, clic3 8es.

  • 8/11/2019 Tiwari Kings 2

    28/28