Professional Documents
Culture Documents
This t ype of display allow s you t o refer t o a piece of inform at ion by it s cat egory. This is t he basis of a t able. A t able is a t wo- dim ensional list of it em s so t hat t he it em s are arr anged by cat egor ies. A com plet e or incom plet e series of it em s t hat r epresent each cat egory is called a record. Therefore, a t able can be r epresent ed as follows:
I n dat abase developm ent , a cat egor y is repr esent ed as a colum n. Som et im es it is also called a field. A r ecor d is repr esent ed as a row .
Table Layout
The Table's Tab
A t able is pr esent ed as a rect angular window represent ed in t he m iddle of t he screen wit h a t ab. As an opt ion, you can rem ove t he t abs and let t he t ables display wit hout t hem . To do t his, you can click t he Office But t on and click Access Opt ions. I n t he left fr am e, click Current Dat abase and, in t he right fr am e, in t he Docum ent Window Opt ions sect ion, click t he Tabbed Docum ent s radio but t on and rem ove t he check m ark on t he Display Docum ent Tabs check box:
Aft er m aking t he select ion, you can click OK. You will be asked t o close and reopen t he dat abase:
Which you should do. On t he left side of it s t op sect ion, a t able pr esent s an icon . The t able icon pr ovides a m enu you can access w hen you r ight - click. The m enu allow s you t o save or change t he view of t he t able.
When a t able displays wit h a t ab, t he ext rem e r ight sect ion of t he t ab( s) show s a close but t on you can click t o close t he t able.
A Table as a D atasheet
Alt hough a t able is prim arily recognized as an ar ranged list of colum ns and r ows, each colum n and each row int ersect t o creat e a rect angular box called a cell:
The cell is act ually t he obj ect t hat holds dat a of a t able. A cell holds only one piece of inform at ion. The dat abase developer decides what t ype of infor m at ion w ould go int o a cell but t he user t ypes t hat inform at ion. Based on it s ar rangem ent of cells, a t able is said t o display in a dat asheet layout or sim ply a dat asheet ( because it s view is m ade of cells) .
The presence or absence of one or bot h scr oll bars is aut om at ically m anaged by t he operat ing syst em and you should not be concerned wit h t he m anagem ent of t he scr oll bar s. At t he sam e t im e, if your users need t o use a t able, t hey know how t o use a scroll bar.
From t he m enu t hat appear s, you can click one. This would open a new t able for you. You can t hen save it .
The N am e of a Table
Like everyt hing t hat is par t of a dat abase, a t able m ust have a nam e t hat can be used t o refer t o t hat obj ect t hroughout t he dat abase and in ot her files t hat can be linked t o t he t able. There are t w o m ain w ays you can specify t he nam e of a t able, eit her w hen you save it for t he fir st t im e or if you decide t o r enam e it . To save a t able you have j ust cr eat ed:
You can click t he Office But t on and click Save You can right - click t he Table_X ( such as Table1) t ab and click Save You can press Ct rl + S You can st ar t closing t he t able. You w ould be pr om pt ed t o save t he change ( if it s st r uct ur e has been changed fr om t he st ruct ur e it had befor e it was opened)
I f a t able has not been saved before, you will be asked t o provide a nam e for t he t able. A t able can have alm ost any nam e: Em ployees, 2&&4DG, Pest es, verTT# @t g, et c. Because you and your users should be able t o easily ident ify a t able, t her e are suggest ions you should follow w hen nam ing it :
The nam e of a t able should reflect t he kind of dat a it is holding You can nam e a t able wit h a few w or ds, w it h spaces You can use a prefix t hat ident ifies t he t able as such, a t able. The nam e of a t able w ould be pr eceded w it h t bl. I f t he nam e includes one wor d, such as Musicians, you can give t he t able a nam e like t blMusicians, anot her nam e w ould be t blSt udent s I f t he nam e of t he t able r eflect s a com binat ion of words, such as Bank Account s or St udent s Academ ic Num ber s, you should st art each new w ord wit h an uppercase. Here are exam ples: t blBankAccount s, t blSt udent Academ icNum bers, t blMem ber Regist rat ions. I n our lessons, w e will not use t he convent ion of pr efixing t he nam e of a dat abase obj ect wit h t hree let t ers. For exam ple, t he nam es of t ables w ill not st ar t wit h t bl. We cam e t o t his decision because m ost ot her dat abase environm ent s, including Microsoft SQL Server , do not suggest t his r ule. Alt hough t he lack of t his rule m ay creat e som e confusion, because you will end up having a t able and a form wit h t he sam e nam e, we w ill st rive t o explicit ly st at e what obj ect t ype w e are r eferring t o. For exam ple, we w ill avoid writ ing, " Open Em ployees" or "Open t he Em ployees obj ect " . I nst ead, we will usually st at e, "Open t he Em ployees t able" .
As w e will see in t he next lesson, som e obj ect s cr eat ed t hat are based on t he t able would be list ed under t he t able nam e in it s cat egory. Here is an exam ple of t w o obj ect s added t o t he sect ion of a t able nam ed Cust om er s:
Each sect ion is expandable and collapsible. To expand a sect ion, click t he nam e of it s sect ion. t o collapse a sect ion, click t he blue header of it s sect ion. Once a t able has been cr eat ed and saved, it is represent ed in t he Navigat ion Pane w it h an icon and a nam e.
Opening a Table
The m ost regular operat ions you will perform on a t able r equir e t hat you open it first . To open a t able, first locat e it in t he Navigat ion Pane t hen:
You can double- click t he t able You can right - click t he t able and click Open
Any of t hese act ions causes t he t able t o display in Dat asheet View in t he cent ral area of t he screen. I n t he sam e w ay, you can open as m any t ables as necessary.
Closing a Table
Aft er using a t able, you can close it . Before closing a t able, fir st select it s t ab. Then, t o close a t able:
Selecting a Table
I n or der t o use a t able, som e oper at ions requir e t hat you ( or rat her t he user) first select ( s) it :
I f you had opened m any t ables and t hey are displaying in t he m ain area of t he screen, t o select one, click it s t ab or it s t it le bar I f you have m any t ables displaying in t he m ain ar ea of t he screen, you can press Ct r l + F6 cont inuously t o swit ch fr om one t able t o t he next unt il t he desired one displays
D eleting a Table
I f you have a t able you don't need anym or e, you can r em ove it from your dat abase. Because you cannot delet e a t able if it is opened, you m ust fir st close it . To rem ove a t able from your dat abase:
I n t he Navigat ion Pane, right - click t he t able and click Delet e I n t he Navigat ion Pane, click t he t able t o select it . Then, on t he ribbon, click Hom e. I n t he Record sect ion, click Delet e I n t he Navigat ion Pane, click t he t able t o select it and press Delet e
I n each case, you will receive a warning t o confirm w hat you w ant t o do. I t is im port ant t o know t hat if you delet e a t able, because it is not a file, it does not go int o t he Recycle Bin: it is lost , including it s records. Ther efor e, before delet ing a t able, m ake sure you really want t o get rid of it . When in doubt , do not delet e it .
N am ing a Colum n
A colum n can have alm ost any nam e: "Book Tit le", "DG$5@H", "This I s The Book Tit le" , "R8% % DW$4" , et c. Som e colum ns will have only t inny dat a, like a person's age, t he num ber of books in an office, a per sons m iddle init ial, et c. I t m ay not be a good idea t o give t hem a nam e t hat w ould t ake t oo m uch space. I n t he fut ur e, when you st art program m ing, it w ould be easier t o handle field nam es t hat are com posed of only one wor d, w it hout space. To nam e a field, fir st figure out w hat t he dat a in t he cat egory will be m ade of. I f you are planning t o ent er em ployees' salar ies in a field, you can j ust call it Salary. I f you want t o specify em ployees nam es by first nam e, m iddle nam e, and last nam e, you can use such colum n nam es and m ake t hem dist inct . I n t his case, you could nam e t he fir st colum n as fir st nam e, t he last nam e would be called last nam e. Alt hough you can use one w ord nam es, som e people m ight be confused. The suggest ion is t o dist inguish w her ever a new English ( or t he language you are using t o design your dat abase) nam e st art s in t he field nam e, by using a st ar t ing uppercase. I nst ead of fir st nam e or fir st nam e, you can use Fir st Nam e or First Nam e. I nst ead of fullnam e or full nam e, you can use FullNam e or Full Nam e.
You can double- click it s header You can right - click a colum n and click Re n a m e Colu m n When any cell under a colum n has focus, on t he ribbon, you can first click Dat asheet . Then, in t he Fields & Colum ns sect ion, click Renam e Colum n.
Any of t hese act ions would put t he nam e of t he colum n int o edit m ode. You can t hen t ype t he new desir ed nam e or change t he exist ing nam e.
6. As t he caret in blinking in t he next colum n header , t ype Or der Tim e and pr ess Ent er 7. As t he caret in blinking in t he next colum n header , t ype Con t a ine r and press Tab
8. Close t he t able 9. When asked w het her you want t o save it , click Yes 10. Type Cu st om e rs Or der s as t he nam e of t he t able 11. Click OK
By default , t he Field Tem plat es w indow is posit ioned on t he r ight side of t he screen. This is a dockable w indow: you can m ove it t o t he left or place it som ewher e else on t he screen. The it em s in t he Field Tem plat es window ar e organized in cat egories ident ified w it h a labeled node, such as Basic Fields, Asset s, or Cont act s. Each node displays a - but t on. This - but t on indicat es t hat t he node is expanded. To collapse a node, you can click it s - but t on, which becom es a + but t on. To expand a node, you can click it s + but t on. Her e is an exam ple where t he Asset s, t he Cont act s, and t he I ssues nodes are collapsed w hile t he Event s and t he Proj ect s nodes ar e expanded:
You can double- click t he field You can click and dr ag t he field fr om t he Field Tem plat es and dr op it on t he t able t o t he left of Add N e w Fie ld :
Selecting a Colum n
Som e oper at ions will requir e t hat you select a colum n but it depends on t he operat ion. I n som e cases, when any cell under a colum n has focus ( for exam ple if t he car et is blinking in a cell of a colum n) , t he colum n is consider ed t o be select ed. Ot herw ise:
To select one colum n, posit ion t he m ouse on it s nam e unt il t he cursor point s down and t hen click
To select colum ns in a range, click and hold your m ouse on one of t hem , t hen drag t o t he
left or t o t he right t o cover t he ot her desir ed colum n or colum ns. When all desir ed colum ns are highlight ed, release t he m ouse
To select a r ange of colum ns, click one colum n t hat will be at one end, press and hold Shift , t hen click t he colum n t hat w ill be at t he ot her end, and r elease Shift
you can posit ion t he m ouse on t he right bor der of a colum n header. The m ouse point er w ould change int o a horizont al double arrow crossed by a ver t ical line:
I f you double- click, t he colum n would be resized t o t he w idest value of t he colum n, pr ovided t he widest value is w ider t han t he colum n header . I f t he w idest value is narr ower t han t he colum n header , t he colum n w idt h would be widened enough t o display t he nam e of t he colum n.
You can click t he colum n's right bor der and dr ag in t he desired dir ect ion, left or right unt il you get t he desir ed w idt h
You can right - click a colum n's nam e and click Colum n Widt h... This would open t he Colum n Widt h dialog box w here you can t ype t he desired value and click OK
M oving a Colum n
I f you find out t hat a part icular colum n is m isplaced in a t able, you can change it s posit ion. To m ove a colum n in Dat asheet View, first select it , click and hold your m ouse on it . Then, st art dragging left or r ight in t he desired direct ion. While your m ouse is m oving, a t hick vert ical line w ill guide you. Once t he ver t ical line is posit ioned t o t he desired locat ion, release t he m ouse:
To m ove a group of colum ns, first select t hem as we r eviewed earlier, click and hold t he m ouse on one of t he select ed colum ns, st ar t dr agging left or r ight in t he desired dir ect ion unt il t he t hick vert ical guiding line is posit ioned in t he desired locat ion, t hen release t he m ouse:
To inser t a colum n using t he ribbon, first click a cell under t he colum n t hat will succeed it . Then, in t he Fields & Colum ns sect ion of t he Dat asheet t ab, click t he I nsert but t on To inser t a colum n fr om t he t able, right - click t he colum n t hat w ill succeed it and click I nsert Colum n To inser t a field from t he Field Tem plat es, click and drag it from t he Field Tem plat es and dr op it t o t he left of t he colum n t hat w ill succeed it
You can double- click it s nam e on t he header You can right - click t he colum n's nam e and click Ren a m e Colum n When any cell under t he colum n has focus, on t he ribbon, click Dat asheet , in t he Fields & Colum ns sect ion, click t he Renam e but t on
Right - click t he Field1 colum n header and click Renam e Colum n 2. Type Cle rk and press Ent er 3. Click t he em pt y cell under Field2 4. I n t he Fields & Colum ns sect ion of t he r ibbon, click t he Renam e but t on 5. Type Fla vor and press Ent er 6. Close t he t able
To hide one or a group of colum ns, you can right - click and click Hide Colum n. You can also right - click any colum n and click Unhide Colum n. This w ould open t he Unhide Colum ns dialog box. Her e is an exam ple:
To hide a colum n, clear it s check box. To r eveal a colum n or a group of colum ns pr eviously hidden, right - click any colum n header on t he t able and click Unhide Colum n. I n t he Unhide Colum ns dialog box, put a check m ar k on each colum n you want t o show.
D eleting a Colum n
I f you have an undesirable colum n in a t able, you can delet e it . I t is im port ant t o keep in m ind t hat if you delet e a colum n, it also goes w it h any infor m at ion under it . To rem ove a colum n from a t able:
You can right - click t he colum n's nam e and click Delet e Colum n You can select t he colum n ( or a group of colum ns) , r ight - click anywhere in t he t able and click Delet e Colum n
You can select a colum n ( or a group of colum ns) . Then, in t he ribbon, click Dat asheet . I n t he Fields & Colum ns sect ion, click t he Delet e but t on
Any of t hese act ions would pr esent you a warning t o confir m whet her you st ill w ant t o delet e t he colum n( s) or you want t o change your m ind. I f you st ill want t o r em ove t he colum n( s) , click Yes.
Lesson Sum m ar y
M CAS: U sing M icr osoft Office Access 20 0 7 Topics
C1 C2 C3 E2 Creat e dat abases Creat e t ables Modify t ables Navigat e am ong records
W atts A loan
1. Cr eat e a blank dat abase and nam e it W a t t s A Loa n 1 2. Aft er t he default I D colum n, creat e t he following addit ional colum ns: Fir st N a m e , M iddleN a m e , La st N a m e , Addr e ss , Cit y , St at e , ZI PCode , Cou nt ry , H om ePh on e , W or k Phone , Em a ilAddr ess , and N ot e s 3. Renam e t he I D colum n as Cu st om e r I D , 4. Save t he t able as Cu st om e r s