Ms Acess 2

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 80

CIA Course Notes

Course Notes
Access 97 Day 2

Produced by CiA Training Ltd Tel : 0191 549 5002

Note: Microsoft and Access are registered trademarks of the Microsoft Corporation CIA Training Ltd 1997 Access 97 Day 2

CIA Course Notes

This material is part of a series of Course Notes that have been designed specifically for use as reference material with tutor-led training courses.

CiA Training Ltd is an accredited ISO 9001 company and the Course Notes range has been designed, developed, tested and validated within the specification of this quality system.

Although Course Notes cover a comprehensive range of topics, we acknowledge that it is impossible to cover absolutely every aspect of the software in -! days of notes. Therefore, we recommend that the manuals provided by the software publisher should be used for specific queries regarding topics not covered in the guides. "ull lists of contents included in our Course Notes titles can be issued on request.

#e have made every effort to ensure that all information and instructions included in these Course Notes is accurate, however, CiA Training $td cannot be held legally responsible for any errors or omissions.

These notes assume that the specific program has been fully installed on the system.

Any constructive comments or suggestions regarding the Course Notes range would be welcomed at any time.

These notes are the Copyright of CiA Training $td. and cannot be copied in any form without the e%press permission of CiA Training $td.

CIA Training Ltd 1997

Access 97 Day 2

CIA Course Notes

Table of Contents
!CT"#N 10 $!P#$T %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%1 CREATE A NEW REPORT EDITIN! REPORT" PRE$IEWIN! A REPORT PRINTIN! A REPORT A'TOREPORT "'((AR) !CT"#N 11 AD&ANC!D !D"T"N' %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%9 C'T+ COP) AND PA"TE RECORD" REPLACIN! TE-T "'((AR) !CT"#N 12 AD&ANC!D ()!$"! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%1* TOTAL" CO'NT !RO'P .) A$ERA!E+ (A-I('( AND (INI('( $AL'E" AND /'ERIE" OR /'ERIE" AND /'ERIE" ON (ORE T0AN ONE 1IELD OR /'ERIE" ON (ORE T0AN ONE 1IELD /'ERIE" ON LIN2ED TA.LE CALC'LATED 1IELD" IN /'ERIE" PARA(ETER /'ERIE" "'((AR) !CT"#N 1* $!LAT"#N +"P %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%22 RELATION"0IP" DELETE A RELATION"0IP EDIT A RELATION"0IP "'((AR) !CT"#N 14 TA,L!: -"!LD P$#P!$T"! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%29 LOO2'P 1IELD 1OR(AT 1IELD PROPERT) DE1A'LT $AL'E $ALIDATION R'LE"4TE-T INP'T (A"2" OT0ER 1IELD PROPERTIE" "'((AR) !CT"#N 15 AD&ANC!D -#$. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ "'.1OR(" 39 3, 32 33 3# 3% 3& 37 23 2& 27 2* 1# 1% 1% 1& 17 17 1* 1* 19 2, 2, 21 1, 11 12 2 # % & 7 *

CIA Training Ltd 1997

Access 97 Day 2

CIA Course Notes


(AIN4"'.1OR( 5 WI6ARD (AIN4"'.1OR( 5 CONTROL WI6ARD LIN2IN! 1OR(" ('LTIPLE TA.LE 1OR(" "'((AR) !CT"#N 10 -#$. C#NT$#L %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%4/ CALC'LATED 1IELD" CO((AND .'TTON" 5 WI6ARD CO(.O .O- 1 5 WI6ARD CO(.O .O- 2 5 WI6ARD CO(.O .O- 3 5 WI6ARD CO(.O .O- 5 (AN'AL LI"T .O-E" OPTION !RO'P" TA. CONTROL "'((AR) !CT"#N 17 -#$. P$#P!$T"! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%09 1OR( PROPERTIE" DATA PROPERTIE" 1OR(AT PROPERTIE" OT0ER PROPERTIE" "'((AR) 7, 71 72 7# 7% #9 %, %2 %% %* &1 &2 &3 &7 &* #, #3 ## #& #7

CIA Training Ltd 1997

Access 97 Day 2

CIA Course Notes

"ection1,5 Re7orts

Section 10 Reports

.y t8e end o9 t8is "ection you s8ou:d ;e a;:e to5 Create a Ne< Re7ort Edit an E=isting Re7ort Pre>ie< a Re7ort Print a Re7ort 'se AutoRe7ort

CIA Training Ltd 1997

Access 97 Day 2

CIA Course Notes

"ection1,5 Re7orts

Create a New Report


A $e1ort is a <ay o9 s8o<ing t8e in9or?ation 9ro? a ta;:e in a ?ore structured and reada;:e 9or?at $e1orts are designed in a si?i:ar <ay to -or2s and o9ten :oo@ t8e sa?e T8e di99erence ;et<een a $e1ort and a -or2 is t8at 9or?s are ?ost o9ten used on t8e screen+ 9or >ie<ing and editing data+ <8i:st re7orts are used to 7resent t8e data in an attracti>e <ay+ usua::y ;y ;eing 7rinted O7en t8e a77ro7riate Database+ se:ect t8e $e1orts ta; and se:ect Ne3 T8e Ne3 $e1ort dia:og ;o= a77ears

$e1ort 4i5ard <i:: create a ste7 ;y ste7 7reAde9ined re7ort Design &ie3 creates a ne< userAde9ined re7ort C6oose t6e table or 7uery8 9ro? t8e dro7 do<n :ist and t8en c:ic@ on Design &ie3 9 #: to start a ne< re7ort W8en Design &ie3 is se:ected+ t8e $e1ort Design 4indo3 is >isi;:e

Too:;o= 1ie:d List

Re7ort

continued o;er

CIA Training Ltd 1997

Access 97 Day 2

CIA Course Notes

"ection1,5 Re7orts

Creating a Report - Continued


T8e $e1ort Design Windo< is s7:it into t8ree sections 5 Page +eader to7 o9 Detail 9ie:ds+ record s8o<n Page -ooter Any 9ie:ds+ te=t etc 7:aced 8ere <i:: a77ear at t8e e>ery 7age o9 t8e re7ort T8is is <8ere t8e actua: re7ort is 7:aced Any te=t+ etc 7:aced 8ere <i:: c8ange 9or eac8

Any 9ie:ds+ te=t etc 7:aced 8ere <i:: a77ear at t8e ;otto? o9 e>ery 7age o9 t8e re7ort

T8ere <i:: a:so ;e a Toolbo< and a -ield List si?i:ar to t8ose o9 t8e -or2 Design <indo< I9 not+ c:ic@ t8e -ield List to >ie< t8e? and Toolbo< ;uttons

T8e <8ite areas are t8e actua: areas o9 t8e re7ort and can ;e c:ic@ed and dragged to any siBe reCuired Drag t8e reCuired 9ie:ds o>er to t8e Detail section T8e $e1ort Design <indo< 8as a Palette <8ic8 <or@s in t8e sa?e <ay as t8at 9or a 9or? "i?7:y c:ic@ on t8e reCuired area and c8ange t8e co:our and ;order 9ro? t8e -or2atting too:;ar To sa>e t8e Re7ort se:ect -ile 9 a;e As=!<1ort%%% 9ro? t8e ?enu "e:ect -ile 9 Close to c:ose t8e re7ort and return to t8e Database 4indo3

Quick Tip Select a list of fields by holding <Shift>, click on the first one then click on the last one. Select alternati e fields by holding <Ctrl> and clicking.

CIA Training Ltd 1997

Access 97 Day 2

CIA Course Notes

"ection1,5 Re7orts

!diting Reports
Once a re7ort design 8as ;een created and sa>ed+ it can ;e o7ened again at any ti?e and c8anged in any <ay+ si?i:ar to editing 9or?s 1ro? t8e Database 4indo3+ se:ect t8e $e1orts ta; "e:ect t8e a77ro7riate re7ort and t8en c:ic@ on Design T8e re7ort is o7ened in t8e $e1ort Design Windo< T8e Toolbo< and -ield List s8ou:d ;e >isi;:e I9 t8ey are not t8en se:ect t8e -ield List ;utton+ and4or t8e Toolbo< ;utton (o>e t8e Toolbo< and -ield List ;y c:ic@ing and dragging t8eir tit:e ;ars i9 t8ey are co>ering t8e $e1ort area To ty7e on t8e $e1ort a ;o= ?ust ;e created into <8ic8 t8e te=t is entered T8is is ca::ed a Label C:ic@ on t8e Label ;utton in t8e Toolbo< To create a Page Title+ c:ic@ and drag a ;o= in t8e centre o9 t8e Page +eader section o9 t8e re7ort t8en ty7e in t8e te=t I9 t8e ;o= is too ;ig or too s?a:: 9or t8e te=t+ c:ic@ e:se<8ere on t8e re7ort t8en se:ect t8e ;o= again A:ter t8e ;o= siBe ;y c:ic@ing and dragging its corners Wit8 t8e ;o= se:ected+ te=t can ;e 9or?atted in t8e usua: ?anner "a>e t8e Re7ort "e:ect -ile 9 Close to c:ose t8e re7ort and return to t8e data;ase <indo< Quick Tip Select View | Report Header/Footer to iew a Report Header and Footer section. Te"t placed in here will appear at the beginning and end of the report respecti ely.

CIA Training Ltd 1997

Access 97 Day 2

CIA Course Notes

"ection1,5 Re7orts

#re iewing a Report


Once a re7ort is created+ to see 8o< t8e re7ort <i:: :oo@ <8en 7rinted+ a Pre;ie3 is used O7en t8e data;ase At t8e Database 4indo3+ se:ect t8e $e1orts ta; to >ie< a:: t8e $e1orts "e:ect t8e $e1ort <8ic8 is to ;e 7re>ie<ed and c:ic@ on t8e Pre;ie3 ;utton T8e $e1ort is no< s8o<n in Print Pre;ie3

Position t8e ?ouse 7ointer o>er t8e D7ageD A it ;eco?es a ?agni9ying g:ass C:ic@ once <it8 t8e ?ouse to Boo? in+ c:ic@ again to Boo? out o9 t8e 7age To >ie< t8e ot8er 7ages in t8e re7ort use t8e Page "ndicator
Pre>ious Page Ne=t Page

1irst Page

Last Page

To c:ose t8e Pre>ie< se:ect -ile 9 Close 9ro? t8e ?enu Quick Tip To close Preview click the close $oo% in and out of the page. button, use the Zoo button to

CIA Training Ltd 1997

Access 97 Day 2

CIA Course Notes

"ection1,5 Re7orts

#rinting a Report
Once a Re7ort is created it can ;e 7rinted at any ti?e Any ne< in9or?ation added to t8e ta;:es <i:: ;e auto?atica::y u7dated to t8e re7orts 1ro? t8e Data;ase Windo<+ Pre;ie3 t8e Re7ort "e:ect -ile 9 Page etu1 1ro? 8ere+ t8e Page #rientation and .argins ?ay ;e c8anged and a di99erent 7rinter se:ected C8ec@ t8at t8e 7rinter is t8e correct one+ t8en c:ic@ on #: EI9 t8e 7rinter s8o<n is not t8e correct one t8en c:ic@ on t8e Printer ;utton ;eside )se 1eci>ic Printer and se:ect t8e correct one 9ro? t8e :ist F

C8ec@ t8at t8e 7rinter is connected and onA:ine C:ic@ on t8e Print ;utton to 7rint t8e <8o:e re7ort or se:ect -ile 9 Print8 to s7eci9y 7rinting o7tions

C:ic@ on #: to 7rint t8e re7ort "e:ect Close to c:ose t8e $e1ort and return to t8e Database 4indo3 Quick Tip & Report can be Pri!ted/Previewed fro% the "ata#a$e %i!dow. Select the Report$ tab, then the report to be printed'pre iewed. Click the Pri!t button or the Pri!t Preview button on the "ata#a$e Tool#ar.

CIA Training Ltd 1997

Access 97 Day 2

&

CIA Course Notes

"ection1,5 Re7orts

&utoReport
T8e Auto$e1ort 9aci:ity ena;:es Cuic@+ si?7:e re7orts to ;e created and 7rinted "e:ect t8e a77ro7riate ta;:e 9ro? t8e Database 4indo3

C:ic@ on t8e Ne<O;Gect5Auto$e1ort ;utton+ A ;asic re7ort <i:: t8en ;e 7roduced and s8o<n in Print Pre;ie3 >ie< It can t8en ;e 7rinted out Print in t8e usua: ?anner "a>e t8e re7ort ;y -ile 9 a;e As=!<1ort%%%

"<itc8 to t8e $e1ort Design 4indo3 ;y c:ic@ing

Quick Tip &utoReport$ can be altered to suit. Switch into "e$i'! View and %ake the appropriate for%atting changes.

CIA Training Ltd 1997

Access 97 Day 2

CIA Course Notes

"ection1,5 Re7orts

Su%%ary
Create a Ne< Re7ort Edit E=isting Re7orts "e:ect Re7orts ta;+ Ne< "e:ect Re7orts ta;+ Design

Pre>ie< a Re7ort

"e:ect Re7orts ta;+

Print a Re7ort

"e:ect Re7orts ta;+

AutoRe7ort

CIA Training Ltd 1997

Access 97 Day 2

CIA Course Notes

"ection 115 Ad>anced Editing

Section 11 &d anced !diting

.y t8e end o9 t8is "ection you s8ou:d ;e a;:e to5 Cut+ Co7y and Paste Te=t Cut+ Co7y and Paste Records 'se Re7:ace

CIA Training Ltd 1997

Access 97 Day 2

CIA Course Notes

"ection 115 Ad>anced Editing

Cut, Copy and #aste Records


"e:ected data or entire records and 9ie:ds can ;e ?o>ed+ co7ied or de:eted "e:ect t8e data to ;e edited and use t8e 9o::o<ing co??ands5 Cut re?o>es se:ected data 9ro? t8e ta;:e and 7uts it in t8e c:i7;oard Co1y co7ies se:ected data to t8e c:i7;oard Paste inserts data t8at <as 7re>ious:y cut or co7ied into t8e ta;:e 9ro? t8e c:i7;oard Note & The clipboard is a part of #indows that contains the last te%t, picture, etc. that was cut or copied from a #indows application. Cut or Co1y "e:ect t8e record4data <8ic8 is to ;e cut4co7ied C8oose t8e !dit 9 Cut co??and ta;:e and 7:aced in t8e c:i7;oard T8e se:ected record is re?o>ed 9ro? t8e

!dit 9 Co1y <or@s in t8e sa?e <ay+ e=ce7t t8e origina: record re?ains in t8e ta;:e Paste (o>e t8e cursor to <8ere t8e record4data is to ;e inserted and se:ect !dit 9 Paste Note & The contents of the clipboard will remain unchanged - the te%t can be pasted many times

Quick Tip (se the Cut Tool#ar. , Cop( and Pa$te buttons fro% the "ata$heet

CIA Training Ltd 1997

Access 97 Day 2

1,

CIA Course Notes

"ection 115 Ad>anced Editing

Replacing Te"t
-ind <i:: :ocate te=t <it8in a ta;:e 'sing $e1lace <i:: a::o< certain te=t to ;e :ocated and c8anged to so?et8ing e:se Position t8e cursor in t8e 9ie:d <8ic8 is to ;e searc8ed 1ro? t8e ?enu se:ect !dit 9 $e1lace%%% T8e H$e1lace in >ield:%%%? dia:og ;o= a77ears

In t8e -ind 46at ;o= ty7e in t8e te=t to ;e 9ound In t8e $e1lace 4it6 ;o= ty7e in t8e te=t to ;e entered "7eci9y <8at to earc6 "n C:ic@ on -ind Ne<t to 9ind t8e 9irst occurrence "e:ect $e1lace to re7:ace t8e 9irst occurrence "e:ect $e1lace All to re7:ace a:: occurrences at once C:ic@ Close to c:ose t8e @$e1lace in >ield:%%%%%? dia:og ;o=

CIA Training Ltd 1997

Access 97 Day 2

11

CIA Course Notes

"ection 115 Ad>anced Editing

Su%%ary
Cut+ Co7y and Paste Data Re7:ace Data + +

!dit 9 $e1lace

CIA Training Ltd 1997

Access 97 Day 2

12

CIA Course Notes

"ection 125 Ad>anced /ueries

Section 1) &d anced *ueries

.y t8e end o9 t8is "ection you s8ou:d ;e a;:e to5 'se Tota:s 'se Count and !rou7 .y Ca:cu:ate t8e A>erage+ (a=i?u? and (ini?u? $a:ue 'se And /ueries 'se Or /ueries 'se And /ueries on ?ore t8an one 1ie:d 'se Or /ueries on ?ore t8an one 1ie:d 'se /ueries on Lin@ed Ta;:es 'se Ca:cu:ated 1ie:ds 'se Para?eter /ueries

CIA Training Ltd 1997

Access 97 Day 2

13

CIA Course Notes

"ection 125 Ad>anced /ueries

Totals
$arious ca:cu:ations can ;e carried out on nu?erica: data <it8in Access T8e ?ost co??on inc:ude 9inding tota:s+ a>erage+ ?a=i?u? >a:ues+ ?ini?u? >a:ues and counting records "tart a Ne3 (uery P:ace t8e 9ie:d on to t8e (uery 'rid 9or <8ic8 t8e tota: is ;e 9ound

C:ic@ on t8e Totals ;utton

9ro? t8e Toolbar

A ne< ro< a77ears on t8e (uery 'rid ?ar@ed Total <it8 t8e de9au:t >a:ue+ 'rou1 ,y

C:ic@ on t8e Total ;o= 9or t8e a77ro7riate 9ie:d C:ic@ on t8e do<n arro< ;o= to ;ring u7 t8e dro7 do<n :ist

C:ic@ on t8e reCuired o7tion 9ro? t8e :ist $un t8e Cuery to 9ind t8e >a:ue Return to t8e (uery Design C:ic@ t8e Totals ;utton again to re?o>e t8e Total ro< 9ro? t8e grid

CIA Training Ltd 1997

Access 97 Day 2

1#

CIA Course Notes

"ection 125 Ad>anced /ueries

Count
T8e count ca:cu:ation counts 8o< ?any entries are in a 7articu:ar 9ie:d It does not count nu:: entries+ i e e?7ty 9ie:ds

Run t8e Cuery to 9ind t8e >a:ue

+roup ,y
T8e ca:cu:ation Count can so?eti?es ;e a ;it :i?iting It counts a:: occurrences in a 9ie:d+ inc:uding du7:icate >a:ues 'sing 'rou1 ,y <i:: s8o< 8o< ?any di99erent >a:ues t8ere are in a 9ie:d

Quick Tip ,y using )roup *( then Cou!t it is possible to find how %any alues there are for each different alue within a field. #lace the field on to the +rid twiceset the first occurrence to )roup *( and the second to Cou!t.

CIA Training Ltd 1997

Access 97 Day 2

1%

CIA Course Notes

"ection 125 Ad>anced /ueries

& erage, .a"i%u% and .ini%u% /alues


T8e A;g ca:cu:ation gi>es t8e a>erage o9 >a:ues in a 9ie:d

T8e .in <i:: ca:cu:ate t8e ?ini?u? >a:ue <it8in a 9ie:d

T8e .a< <i:: ca:cu:ate t8e ?a=i?u? >a:ue <it8in a 9ie:d

CIA Training Ltd 1997

Access 97 Day 2

1&

CIA Course Notes

"ection 125 Ad>anced /ueries

&nd *ueries
W8en it is necessary t8at t<o conditions ?ust ;e ?et in a sing:e 9ie:d+ t8en t8e And o7erator is used

1or e=a?7:e+ A50 And B100 <i:: 9ind a:: >a:ues t8at are greater t6an 50 but less t6an 100

0r *ueries
I9 a >a:ue <it8in a 7articu:ar 9ie:d needs to ?atc8 one o9 t<o or ?ore conditions+ t8en t8e conditions ?ay ;e entered into t8e a77ro7riate 9ie:d on t8e Cuery grid se7arated ;y #r

1or e=a?7:e+ underland #r .ary1ort <i:: 9ind all occurrences o9 underland and .ary1ort <it8in t8e 9ie:d

CIA Training Ltd 1997

Access 97 Day 2

17

CIA Course Notes

"ection 125 Ad>anced /ueries

&nd *ueries on %ore than one 1ield


I9 a searc8 is reCuired t8at needs t<o se7arate conditions in di99erent 9ie:ds to ;e satis9ied+ t8en t8e conditions ?ay ;e 7:aced in t8e a77ro7riate 9ie:ds in t8e Cuery grid+ on t8e sa?e ro<

Wi:: 9ind a:: 8ouses in underland greater t6an C*0D000

0r *ueries on %ore than one field


I9 a searc8 is reCuired t8at 8as t<o a:ternati>e conditions in se7arate 9ie:ds t8en t8e t<o conditions are 7ut on se7arate :ines o9 t8e Cuery grid

Wi:: 9ind a:: 8ouses in underland greater t6an C*0D000 and a:: t8e 8ouses in .ary1ort 3it6 * bedroo2s

CIA Training Ltd 1997

Access 97 Day 2

1*

CIA Course Notes

"ection 125 Ad>anced /ueries

*ueries on 2inked Table


In order to 7ro>ide a rea::y 7o<er9u: data 7rocessing syste?+ Access a::o<s t8e user to 7er9or? Cueries on ?ore t8an one ta;:e at a ti?e In order 9or Access to do t8is+ t8e ta;:es ?ust 9irst 8a>e ;een :in@ed ;y a re:ations8i7 "tart a ne< Cuery Cueried At t8e Add Table dia:og ;o=+ se:ect t8e ta;:es to ;e

I9 t8e ta;:es 8a>e ;een de9ined 7ro7er:y+ t8en t8e t<o 9ie:d :ists <i:: a77ear at t8e to7 o9 t8e (uery 'rid+ Goined ;y a :ine In t8e usua: ?anner se:ect t8e 9ie:ds reCuired "7eci9y t8e Criteria

Run t8e /uery Note& 'nly tables with common fields (i.e. the information is the same) can be linked.

CIA Training Ltd 1997

Access 97 Day 2

19

CIA Course Notes

"ection 125 Ad>anced /ueries

Calculated 1ields in *ueries


Ca:cu:ated 1ie:ds are used <8en a ca:cu:ation is reCuired on t<o or ?ore 9ie:ds Any ?at8e?atica: ca:cu:ation can ;e carried out Enter t8e na?e 9or t8e ne<:y created 9ie:d Ty7e in a co:on t8en create t8e ca:cu:ation Re?e?;er t8at 9ie:ds ?ust ;e enc:osed <it8in t8e sCuare ;rac@ets

#ara%eter *ueries
I9 a 9ie:d is ;eing Cueried constant:y and a:: t8at is c8anging is t8e criteria t8at is ;eing entered+ t8en a Para2eter &alue can ;e used A Para?eter /uery is a Cuery t8at <8en run dis7:ays a dia:og ;o= 7ro?7ting 9or t8e criteria to ;e entered Once t8e criteria is entered into t8e dia:og ;o= t8e Cuery is carried out To create a Para?eter >a:ue o7en s7uare bracEets and ty7e t8e te=t <8ic8 is to a77ear <it8in t8e dia:og ;o= C:ose t8e sCuare ;rac@ets

W8en t8e Cuery is sa>ed and c:osed+ t8e Cuery is run 9ro? t8e Database 4indo3 ;y se:ecting it and c:ic@ing on #1en A dia:og ;o= <i:: ;e dis7:ayed 7ro?7ting 9or t8e criteria Enter t8e criteria and c:ic@ on #: to >ie< t8e resu:ts

CIA Training Ltd 1997

Access 97 Day 2

2,

CIA Course Notes

"ection 125 Ad>anced /ueries

Su%%ary
Tota:s Count !rou7 .y A>erage $a:ues (a=i?u? $a:ues (ini?u? $a:ues And /ueries Or /ueries Ca:cu:ated /ueries Count !rou7 .y A>g (a= (in And Or Ca:cu:ated 1ie:d Na?e 5 I1ie:dJ ?at8e?atica: sy?;o: I1ie:dJ IEnter te=t to a77ear in dia:og ;o=J

Para?eter /ueries

CIA Training Ltd 1997

Access 97 Day 2

21

CIA Course Notes

"ection 135 Re:ations8i7s

Section 13 Relationships

.y t8e end o9 t8is "ection you s8ou:d ;e a;:e to5 'nderstand Ta;:e Re:ations8i7s Create Re:ations8i7s De:ete Re:ations8i7s

CIA Training Ltd 1997

Access 97 Day 2

22

CIA Course Notes

"ection 135 Re:ations8i7s

Relationships
Re:ations8i7s e=7and t8e :in@ t8at <as created ;et<een t<o ta;:es T8ere are t8ree ty7es o9 re:ations8i7s5 oneFtoF2any+ 2anyFtoF2any and oneFtoFone T8e ?ost co??on:y used is oneFtoF2any T8is a::o<s a record in one ta;:e to 8a>e ?ore t8an one ?atc8ing record in anot8er ta;:e O7en t8e Database <8ic8 contains t8e ta;:es <8ic8 are to ;e re:ated 1ro? t8e Database 4indo3 se:ect Tools 9 $elations6i1s%%% T8e 6o3 Table dia:og ;o= a77ears Add t8e reCuired Tables and c:ic@ on Close T8e $elations6i1 4indo3 is >isi;:e containing t8e ta;:es <it8 t8eir 9ie:ds :isted

T8e Ta;:e Lists can ;e ?o>ed around ;y c:ic@ing on t8e Tit:e ;ar and dragging to a ne< 7osition ResiBe t8e Ta;:e :ists ;y 7ositioning t8e ?ouse o>er t8e Ta;:e List ;order Et8e ?ouse <i:: c8ange to a dou;:e 8eaded arro<F+ c:ic@ and drag to resiBe t8e List Re:ations8i7s are created ;y dragging t8e 9ie:d 9ro? one ta;:e on to t8e 9ie:d in anot8er ta;:e W8en dragging t8e 9ie:d+ it ?ust ;e t8e 9ie:d 9ro? t8e one side o9 t8e re:ations8i7 t8at is dragged on to t8e 9ie:d in t8e ?any side o9 t8e re:ations8i7 continued o;er

CIA Training Ltd 1997

Access 97 Day 2

23

CIA Course Notes

"ection 135 Re:ations8i7s

Relationships - Continued
Once dragged+ t8e $elations6i1s dia:og ;o= a77ears

!n>orce $e>erential "ntegrity ensures t8at data ?ust ;e in t8e one side ta;:e ;e9ore it can ;e entered into t8e ?any sided ta;:e C8ec@ t8is o7tion to create a re:ations8i7 Cascade )1date $elated -ields I9 t8e data is c8anged in t8e 9ie:d on t8e one side o9 t8e re:ations8i7 t8en it <i:: auto?atica::y ;e c8anged in e>ery record in t8e ?any side o9 t8e re:ations8i7 Cascade Delete $elated $ecords T8is ensures t8at i9 a record is de:eted 9ro? t8e one side ta;:e t8en a:: records t8at are re:ated to t8at record <i:: ;e de:eted C6ecE t8e reCuired o7tions C:ic@ Create to create t8e re:ations8i7

continued o;er

CIA Training Ltd 1997

Access 97 Day 2

2#

CIA Course Notes

"ection 135 Re:ations8i7s

Relationships - Continued
A :ine <i:: a77ear ;et<een t8e t<o re:ated ta;:es+ s7eci9ying t8e $elations6i1

Create a:: re:ations8i7s in t8e sa?e <ay "e:ect -ile 9 a;e to sa>e t8e re:ations8i7s "e:ect -ile 9 Close to c:ose t8e $elations6i1 4indo3 and return to t8e Database 4indo3

Quick Tip Click to iew the Relatio!$hip %i!dow. #ress Save to sa e the

Relatio!$hip$. Click to iew the Show Ta#le dialog bo" fro% which %ore tables can be added to create the relationships.

CIA Training Ltd 1997

Access 97 Day 2

2%

CIA Course Notes

"ection 135 Re:ations8i7s

4elete a Relationship
Once a re:ations8i7 8as ;een created it is a si?7:e 7rocess to de:ete it O7en t8e data;ase and >ie< t8e Re:ations8i7s Windo< "e:ect t8e re:ations8i7 <8ic8 is to ;e de:eted ;y c:ic@ing on t8e :ine T8e :ine <i:: a77ear e?;o:dened

1ro? t8e ?enu se:ect !dit 9 Delete

"e:ect Ges at t8e con9ir?ation dia:og ;o= T8e re:ations8i7 is no< de:eted "a>e t8e c8anges and c:ose t8e $elations6i1 4indo3

CIA Training Ltd 1997

Access 97 Day 2

2&

CIA Course Notes

"ection 135 Re:ations8i7s

!dit a Relationship
Once re:ations8i7s 8a>e ;een created it is a si?7:e tas@ to c8ange t8e re:ations8i7 "e:ect t8e re:ations8i7 <8ic8 is to ;e c8anged ;y c:ic@ing on t8e :ine 1ro? t8e ?enu se:ect $elations6i1s 9 !dit $elations6i1%%% T8e $elations6i1s dia:og ;o= is >isi;:e C8ange t8e reCuired o7tions and c:ic@ on #: a;e t8e c8anges and c:ose t8e re:ations8i7 Windo<

Quick Tip 0nce a relationship line has been selected click with the ri'ht ou$e button on the line to iew a short cut %enu fro% which the relationship can be deleted'edited. Select the line and press <"elete> to delete the relationship.

CIA Training Ltd 1997

Access 97 Day 2

27

CIA Course Notes

"ection 135 Re:ations8i7s

Su%%ary
$ie< Re:ations8i7s Create Re:ations8i7 De:ete Re:ations8i7s C:ic@ and drag 9ie:d o>er C:ic@ once on t8e :ine+ 7ress BDelA

CIA Training Ltd 1997

Access 97 Day 2

2*

CIA Course Notes

"ection 1#5 Ta;:e5 1ie:d Pro7erties

Section 15 Table6 1ield #roperties

.y t8e end o9 t8is "ection you s8ou:d ;e a;:e to5 Create Loo@u7 1ie:ds 'nderstand 1ie:d Pro7erties "7eci9y 1or?ats 1or a 1ie:d "et De9au:t $a:ues 1or 1ie:ds "et $a:idation Ru:es and Te=t Create an In7ut (as@ Inde= 1ie:ds

CIA Training Ltd 1997

Access 97 Day 2

29

CIA Course Notes

"ection 1#5 Ta;:e5 1ie:d Pro7erties

2ookup 1ield
W8en creating ta;:e 9ie:ds+ it is 7ossi;:e to create a 9ie:d t8at a:ready contains t8e >a:ues t8at are to ;e in7utted T8is is ca::ed a LooEu1 >ield and <i:: s7eed u7 data in7ut and reduce ty7ing ?ista@es O7en t8e ta;:e in Design $ie< Ty7e in t8e 9ie:d na?e and 9ro? t8e Data Ty1e dro7 do<n :ist c8oose LooEu1 4i5ard

1ro? t8e LooEu1 4i5ard c8oose " 3ill ty1e in t6e ;alues t6at " 3ant and c:ic@ Ne<t "7eci9y t8e Nu2ber o> colu2ns5 as 1 and enter t8e reCuired >a:ues into it

C:ic@ Ne<t continued o;er


CIA Training Ltd 1997 Access 97 Day 2 3,

CIA Course Notes

"ection 1#5 Ta;:e5 1ie:d Pro7erties

2ookup 1ield - Continued


Enter t8e :a;e: na?e Ei e 9ie:d na?eF t8en c:ic@ -inis6

"a>e t8e ta;:e and s<itc8 to Datas6eet >ie< T8e >a:ues can eit8er ;e ty7ed in or c8osen 9ro? t8e dro7 do<n :ist Quick Tip To add're%o e an ite% fro% the +ookup field, switch to "e$i'! iew, select the field and fro% the Field Propertie$ choose +ookup. 1ro% Row Source add're%o e the appropriate ite%, entering the correct synta".

CIA Training Ltd 1997

Access 97 Day 2

31

CIA Course Notes

"ection 1#5 Ta;:e5 1ie:d Pro7erties

1or%at 1ield #roperty


W8en a ta;:e is ;eing created it is 7ossi;:e to s7eci9y certain 9or?atting o7tions 9or t8e 9ie:ds O7en t8e ta;:e in Design &ie3 and se:ect t8e 9ie:d to ;e 9or?atted In t8e ;otto? o9 t8e ta;:e Design 'rid t8e -ield Pro1erties can ;e >ie<ed

C:ic@ in t8e -or2at 1ie:d Pro7erty to >ie< t8e dro7 do<n arro< Note& The Format of a Field will change depending on the Data Type of the field. C8oose t8e reCuired 9or?at 9ro? t8e o7tions gi>en I9 t8e Data Ty7e is Te<t+ t8en t8e -or2at o7tions are ;:an@ 9or?atting o7tions are5 B A "o?e use9u:

Con>erts a:: te=t in t8e 9ie:d to :o<ercase Con>erts a:: te=t in t8e 9ie:d to u77ercase

"a>e t8e ta;:e+ s<itc8 to Datas6eet >ie< to see t8e 9or?at Quick Tip #osition the cursor within For at and press <F,> to iew 7elp on For at options.

CIA Training Ltd 1997

Access 97 Day 2

32

CIA Course Notes

"ection 1#5 Ta;:e5 1ie:d Pro7erties

4efault /alue
A De9au:t $a:ue is added auto?atica::y into a 9ie:d and is used to sa>e ti?e on data entry <8en ne< records are to ;e added W8en records are added t8e de9au:t >a:ue can eit8er ;e acce7ted or c8anged O7en t8e ta;:e in Design &ie3 and se:ect t8e 9ie:d 9or <8ic8 t8e De>ault &alue is to ;e set 1ro? t8e -ield Pro1erties c:ic@ once in De>ault &alue Ty7e in t8e te=t4nu?;ers to ;e used as t8e De>ault &alue

"a>e t8e Ta;:e and C:ose !<a21les o> use>ul De>ault &alues Data Ty1e Te=t Date4Ti?e Nu?;er De>ault &alue No KDateEF 1 Co22ents Auto?atica::y inserts No into t8e 9ie:d Auto?atica::y inserts current date Auto?atica::y inserts 1 in t8e 9ie:d

CIA Training Ltd 1997

Access 97 Day 2

33

CIA Course Notes

"ection 1#5 Ta;:e5 1ie:d Pro7erties

/alidation Rules'Te"t
$a:idation Ru:es <i:: c8ec@ 9or any 7articu:ar <ords or 78rases t8at are ;eing ty7ed into a 9ie:d I9 t8e ?atc8 is not e=act to t8e s7eci9ication in t8e $a:idation Ru:e+ t8en t8e in9or?ation <i:: not ;e acce7ted into t8e 9ie:d and an error ?essage <i:: a77ear E$a:idation Te=tF e=7:aining <8y t8e data cou:d not ;e acce7ted O7en t8e ta;:e in Design &ie3 and se:ect t8e a77ro7riate 9ie:d C:ic@ on t8e &alidation $ule and ty7e in t8e te=t4nu?;ers <8ic8 can on:y ;e acce7ted into t8e 9ie:d Enc:ose t8e >a:idation te=t <it8in 7uotation 2arEs and se7arate eac8 <ord <it8 #$ E g HWordL or HE=ce:L or HAccessL or HPo<erPointL T8is <i:: on:y a::o< t8ese 9our <ords to ;e entered into t8e 9ie:d 9or <8ic8 t8e $a:idation Ru:e 8as ;een set In t8e &alidation Te<t ;o= enter t8e te=t <8ic8 is to ;e >ie<ed i9 t8e &alidation $ule is ;ro@en E g On:y Word+ E=ce:+ Access or Po<erPoint can ;e entered into t8is 9ie:d

"a>e t8e Ta;:e and s<itc8 to Datas8eet >ie< Ty7e in te=t t8at de9ies t8e &alidation $ule A t8e &alidation Te<t s8ou:d a77ear Quick Tip To cancel a record'te"t once it has been entered 8but not yet sa ed9 into the table press <-$c>.

CIA Training Ltd 1997

Access 97 Day 2

3#

CIA Course Notes

"ection 1#5 Ta;:e5 1ie:d Pro7erties

:nput .asks
In7ut (as@s contro: 8o< data is entered and dis7:ayed in a 9ie:d O7en t8e ta;:e in Design &ie3 and se:ect t8e a77ro7riate 9ie:d C:ic@ on t8e "n1ut .asE and create an in7ut ?as@ using t8e 9o::o<ing sy?;o:s5 .asE C6aracter , 9 M L O A a P C + 54 Q R S T )sed >or Nu?;er A entry reCuired Nu?;er A entry not reCuired Nu?;er+ N or A+ or s7ace A entry not reCuired Letter A entry reCuired Letter A entry not reCuired Letter or Nu?;er A entry reCuired Letter or Nu?;er A entry not reCuired Any c8aracter or s7ace A entry reCuired Any c8aracter or s7ace A entry not reCuired Deci?a: 7oint and t8ousands se7arators Date and ti?e se7arators Con>erts c8aracters to t8e rig8t to :o<ercase Con>erts c8aracters to t8e rig8t to u77ercase (as@ 9i::s 9ro? rig8t to :e9t (a@es t8e c8aracter t8at 9o::o<s to ;e dis7:ayed as itse:9 e g T9 <i:: ;e dis7:ayed as 9

"a>e t8e ta;:e+ s<itc8 to Design &ie3 or Close t8e ta;:e

Quick Tip #lace the cursor in .!put /a$k and click on the *uild button .!put /a$k ia the %i0ard. to create an

CIA Training Ltd 1997

Access 97 Day 2

3%

CIA Course Notes

"ection 1#5 Ta;:e5 1ie:d Pro7erties

0ther 1ield #roperties


Ot8er 1ie:d Pro7erties t8at can ;e a:tered are5 -ield i5e "et to restrict 8o< ?uc8 te=t can ;e entered into a 9ie:d Ca1tion Te=t entered 8ere <i:: a77ear as t8e 1ie:d Na?e

$e7uired I9 set to )es+ t8e 9ie:d cannot ;e :e9t ;:an@ "nde<ed Wi:: auto?atica::y sort t8e data in ascending order

CIA Training Ltd 1997

Access 97 Day 2

3&

CIA Course Notes

"ection 1#5 Ta;:e5 1ie:d Pro7erties

Su%%ary
Loo@u7 1ie:ds Table 9 Design &ie3 9 Data Ty1e 9 LooEu1 4i5ard Table 9 Design &ie3

"et 1ie:d Pro7erties

CIA Training Ltd 1997

Access 97 Day 2

37

CIA Course Notes

"ection 1%5 Ad>anced 1or?s

Section 1; &d anced 1or%s

.y t8e end o9 t8is "ection you s8ou:d ;e a;:e to5 'nderstand (ain4"u;9or?s Create (ain4"u;9or?s Create a Lin@ed 1or? Create a 1or? 9ro? (u:ti7:e Ta;:es

CIA Training Ltd 1997

Access 97 Day 2

3*

CIA Course Notes

"ection 1%5 Ad>anced 1or?s

Subfor%s
W8en ta;:es 8a>e ;een :in@ed it is 7ossi;:e to create a 9or? <8ic8 <i:: s8o< t8e in9or?ation t8at is :in@ed toget8er T8is is @no<n as a .ain>or24 ub>or2 As t8e records c8ange in t8e .ain -or2 so <i:: t8e in9or?ation in t8e ub>or2 A "u;9or? is a se7arate 9or? <8ic8 is inserted into a ?ain 9or?

(ain9or?

"u;9or?

CIA Training Ltd 1997

Access 97 Day 2

39

CIA Course Notes

"ection 1%5 Ad>anced 1or?s

.ain'Subfor% 6 <i$ard
O7en t8e data;ase 1ro? t8e data;ase <indo< se:ect t8e -or2s ta; and c:ic@ on Ne3 to start a ne< 9or? C8oose -or2 4i5ard and C6oose t6e table%%% <8ic8 is to ;e used 9or t8e ?ain 9or?

C:ic@ #: Access @no<s <8at ta;:e is to ;e used 9or t8e ?ain 9or? A it no< needs to @no< <8ic8 9ie:ds are to ;e s8o<n "e:ect <8ic8 9ie:ds are to ;e >ie<ed on t8e 9or? ;y eit8er c:ic@ing on t8e 9ie:d t8en A or c:ic@ AA to >ie< a:: t8e 9ie:ds

CIA Training Ltd 1997

Access 97 Day 2

#,

CIA Course Notes

"ection 1%5 Ad>anced 1or?s


continued o;er

CIA Training Ltd 1997

Access 97 Day 2

#1

CIA Course Notes

"ection 1%5 Ad>anced 1or?s

.ain'Subfor% 6 <i$ard - Continued


1ro? Tables=(ueries c8oose t8e ta;:e <8ic8 contains t8e 9ie:d 9or t8e su;9or? In t8e sa?e ?anner c8oose <8ic8 9ie:ds are to a77ear on t8e "u;9or? T8e :in@ing 9ie:d does not need to ;e >ie<ed C:ic@ Ne<t C:ic@ Ne<t t8en Ne<t again C8oose a tyle t8en Ne<t Enter t8e tit:es 9or t8e ?ain and su;9or?

C:ic@ on -inis6 T8e 9or? <i:: a77ear a;e t8e 9or? and Close it

T8e 9or?s can ;e o7ened and ?odi9ied in t8e usua: ?anner

CIA Training Ltd 1997

Access 97 Day 2

#2

CIA Course Notes

"ection 1%5 Ad>anced 1or?s

.ain'Subfor% 6 Control <i$ard


T8e (ain4"u;9or? can ;e easi:y created <it8out using t8e -or2 4i5ard O7en t8e data;ase and create t8e t<o 9or?s ;ased on t8e ta;:es t8at are :in@ed toget8er O7en t8e 2ain 9or? in Design $ie< $ie< t8e Toolbo< and ensure t8e Control 4i5ards are turned on 1ro? t8e Toolbo< c:ic@ t8e ub>or2= ubre1ort ;utton Position t8e ?ouse o>er t8e 9or? and dra< a rectang:e <8ere t8e "u;9or? is to a77ear T8e "u;9or? 4 "u;re7ort WiBard dia:og ;o= a77ears

1ro? t8e dia:og ;o= c8oose t8e su;9or? 9or? and c:ic@ Ne<t C8oose Ne<t again a9ter se:ecting t8e reCuired o7tions 1ina::y+ c8ange t8e na?e o9 t8e 9or?+ i9 reCuired+ t8en c:ic@ on -inis6 A9ter a 9e< seconds t8e 9or? a77ears "a>e t8e 9or? "<itc8 to -or2 &ie3 to try out t8e (ain4"u;9or? Quick Tip (se <Ctrl Ta#> and <Shift Ctrl Ta#> to %o e to ne"t'pre ious field of the .ainfor% fro% the Subfor%. (se <-!d> to %o e to the Subfor% fro% the .ainfor%.

CIA Training Ltd 1997

Access 97 Day 2

#3

CIA Course Notes

"ection 1%5 Ad>anced 1or?s

2inking 1or%s
Instead o9 creating a (ain9or?4su;9or?+ it is 7ossi;:e to :in@ 9or?s toget8er T8e ?ain 9or? <i:: ;e >ie<ed and <8en a record is c8osen+ a ;utton is 7ressed <8ic8 <i:: o7en u7 t8e su;9or? <it8 t8e :in@ed data on it $ery use9u: 9or 9or?s <8ic8 contain a :ot o9 in9or?ation O7en t8e data;ase 1ro? t8e data;ase <indo< se:ect t8e -or2s ta; and c:ic@ on Ne3 to start a ne< 9or? C8oose -or2 4i5ard and C6oose t6e table%%% <8ic8 is to ;e used 9or t8e ?ain 9or?

C:ic@ #: Access @no<s <8at ta;:e is to ;e used 9or t8e ?ain 9or? A it no< needs to @no< <8ic8 9ie:ds are to ;e s8o<n "e:ect <8ic8 9ie:ds are to ;e >ie<ed on t8e 9or? ;y eit8er c:ic@ing on t8e 9ie:d t8en A or c:ic@ AA to >ie< a:: t8e 9ie:ds

continued o;er
CIA Training Ltd 1997 Access 97 Day 2 ##

CIA Course Notes

"ection 1%5 Ad>anced 1or?s

2inking 1or%s - Continued


1ro? Tables=(ueries c8oose t8e ta;:e <8ic8 contains t8e 9ie:d 9or t8e :in@ed 9or? In t8e sa?e ?anner c8oose <8ic8 9ie:ds are to a77ear on t8e :in@ed 9or? T8e :in@ing 9ie:d does not need to ;e >ie<ed C:ic@ Ne<t "e:ect to >ie< t8e 9or?s as LinEed 9or?s

C:ic@ Ne<t C8oose a tyle t8en Ne<t Enter t8e tit:es 9or t8e ?ain and su;9or?

C:ic@ on -inis6 T8e 9or? <i:: a77ear "e:ect a record and c:ic@ on t8e ;utton to o7en u7 t8e :in@ed 9or? C:ose t8e :in@ed 9or? to return to t8e (ain9or?
CIA Training Ltd 1997 Access 97 Day 2 #%

CIA Course Notes

"ection 1%5 Ad>anced 1or?s

.ultiple Table 1or%s


1or?s can ;e created using di99erent 9ie:ds 9ro? di99erent ta;:es Create a (uery <8ic8 contains a:: t8e 9ie:ds t8at are reCuired on t8e 9or? "a>e t8e Cuery 1ro? t8e Database 4indo3+ se:ect t8e -or2s ta; and c:ic@ on Ne3 to start a ne< 9or? At t8e C6oose a table or 7uery+ c:ic@ on t8e do<n arro< and c8oose t8e Cuery <8ic8 8as Gust ;een created C:ic@ on Design &ie3 Design t8e 1or? in t8e usua: ?anner "a>e t8e 9or? and s<itc8 to -or2 &ie3 T8e 1or? is no< s8o<ing t8e 9ie:ds 9ro? di99erent ta;:es Data can eit8er ;e entered or >ie<ed 9ro? t8e 1or?

Quick Tip &n alternati e %ethod is to use the For %i0ard. <hen choosing the fields fro% the table the for% is based on, select another table fro% Ta#le/Querie$ and add the appropriate fields.

CIA Training Ltd 1997

Access 97 Day 2

#&

CIA Course Notes

"ection 1%5 Ad>anced 1or?s

Su%%ary
Create A "u;9or? Create a Lin@ed 1or? (u:ti7:e Ta;:e 1or?s -or2 9 Ne3 9 -or2 4i5ard -or2 9 Ne3 9 -or2 4i5ard Create /uery t8en create a 9or? ;ased on t8at Cuery

CIA Training Ltd 1997

Access 97 Day 2

#7

CIA Course Notes

"ection 1&5 1or? Contro:s

Section 1= 1or% Controls

.y t8e end o9 t8is section you s8ou:d ;e a;:e to5 Create Ca:cu:ated 1ie:ds Create Co??and .uttons Create Co?;o .o=es Create List .o=es Create O7tion !rou7s Create Ta;s

CIA Training Ltd 1997

Access 97 Day 2

#*

CIA Course Notes

"ection 1&5 1or? Contro:s

Calculated 1ields
A ca:cu:ated contro: uses an e=7ression to o;tain its in9or?ation T8ese 9ie:ds are ca:cu:ated ;y using ot8er in9or?ation 9ro? t8e data;ase and are ca:cu:ated eac8 ti?e t8ey are reCuired T8ey are not stored in any 9ie:d O7en t8e 9or?+ in design >ie<+ on <8ic8 t8e ca:cu:ated 9ie:d is to ;e created $ie< t8e Toolbo<

1ro? t8e Toolbo< c:ic@ on t8e Te<t ,o< to enter t8e ca:cu:ation

;utton and dra< a ;o= in <8ic8

C:ic@ in t8e ;o= <it8 unbound in it and ty7e in t8e ca:cu:ation 'se t8e nor?a: ?at8e?atica: sy?;o:s to create t8e e=7ression EK+N+A+U and 4F C:ic@ on t8e Label to t8e :e9t o9 t8e ca:cu:ation and enter t8e a77ro7riate tit:e Note& #hen referring to another control*field the name of the control*field must be entered within square brackets. "a>e t8e 9or?+ s<itc8 to -or2 &ie3 T8e correct ans<er to t8e ca:cu:ation a77ears in t8e 9ie:d As t8e record c8anges t8e ca:cu:ation <i:: reca:cu:ate

Quick Tip &ny kind of %athe%atical calculation can be perfor%ed e.g. & erage, Su%, .a", .in etc.

CIA Training Ltd 1997

Access 97 Day 2

#9

CIA Course Notes

"ection 1&5 1or? Contro:s

Co%%and ,uttons 6 <i$ard


A co??and ;utton is a ;utton t8at <8en 7ressed <i:: carry out an action Co??and ;uttons are used to c:ose 9or?s+ o7en 9or?s+ 7rint etc O7en t8e 9or? in Design $ie< Ensure t8e Toolbo< is >isi;:e and t8e Control 4i5ard is turned on

"cro:: do<n to t8e 9ooter No<+ c:ic@ on t8e Co22and ,utton+ c:ic@ in t8e 9ooter <8ere t8e ;utton is reCuired T8e Co22and ,utton 4i5ard a77ears

and

C8oose a Category to >ie< t8e Actions5 t8at can ;e carried out Once t8e Action is se:ected c:ic@ on Ne<t

continued o;er

CIA Training Ltd 1997

Access 97 Day 2

%,

CIA Course Notes

"ection 1&5 1or? Contro:s

Co%%and ,utton 6 <i$ard - Continued


C8oose eit8er to s8o< Te<t or a Picture on t8e ;utton

C:ic@ Ne<t !i>e t8e ;utton a na?e and c:ic@ on -inis6

"a>e t8e 9or?+ s<itc8 to -or2 &ie3 and try out t8e ne< ;utton

CIA Training Ltd 1997

Access 97 Day 2

%1

CIA Course Notes

"ection 1&5 1or? Contro:s

Co%bo ,o" 1 6 <i$ard


A co?;o ;o= is a 9ie:d <8ic8 <i:: a::o< ne< >a:ues to ;e entered into a 9ie:d or a >a:ue to ;e c8osen 9ro? a dro7 do<n :ist <8ic8 is dis7:ayed once t8e 9ie:d is se:ected Co?;o ;o=es can ;e created ;y eit8er :oo@ing u7 t8e >a:ues 9ro? a ta;:e or ;y entering t8e >a:ues <8ic8 are to ;e >ie<ed in t8e Co?;o .o= O7en t8e -or2 in Design &ie3 1ro? t8e Toolbo<+ ensure t8e Control 4i5ard is turned on Re?o>e t8e 9ie:d t8e co?;o ;o= is to re7:ace ;y se:ecting it and 7ressing QDeleteR

C:ic@ once on t8e Co2bo ,o< ;utton+ Position t8e 7ointer <8ere t8e co?;o ;o= is reCuired and drag to t8e s8a7e o9 a rectang:e A9ter a 9e< seconds t8e Co2bo ,o< 4i5ard a77ears

"e:ect " 3ant t6e co2bo bo<8%%% C:ic@ Ne<t continued o;er

CIA Training Ltd 1997

Access 97 Day 2

%2

CIA Course Notes

"ection 1&5 1or? Contro:s

Co%bo ,o" 1 - Continued


"e:ect t8e Table <8ere t8e co?;o ;o= is to 9ind its >a:ues

C:ic@ Ne<t "e:ect 46ic6 >ield%%% t8e in9or?ation is stored in

C:ic@ Ne<t continued o;er


CIA Training Ltd 1997 Access 97 Day 2 %3

CIA Course Notes

"ection 1&5 1or? Contro:s

Co%bo ,o" 1 - Continued


ResiBe t8e co:u?n so a:: in9or?ation is dis7:ayed+ t8en c:ic@ on Ne<t "e:ect tore t6at ;alue in t6is >ield and c8oose t8e 9ie:d t8at t8e >a:ue is to ;e stored in+ once it is c8osen 9ro? t8e co?;o ;o=

C:ic@ Ne<t Ty7e in a Label 9or t8e Co2bo ,o<

C:ic@ -inis6 ,o<

"a>e t8e 9or?+ s<itc8 to -or2 &ie3 and try out t8e Co2bo

CIA Training Ltd 1997

Access 97 Day 2

%#

CIA Course Notes

"ection 1&5 1or? Contro:s

Co%bo ,o" ) 6 <i$ard


T8is co?;o ;o= <i:: s8o< t8e >a:ues t8at 8a>e ;een entered O7en t8e 9or? in design >ie<+ re?o>e t8e 9ie:d <8ic8 is to ;e re7:aced ;y t8e co?;o ;o= Ensure t8e Control 4i5ard is on C:ic@ t8e Co2bo bo< ;utton and dra< t8e co?;o ;o=

"e:ect " 3ill ty1e in t6e ;alues t6at " 3ant C:ic@ Ne<t

continued o;er

CIA Training Ltd 1997

Access 97 Day 2

%%

CIA Course Notes

"ection 1&5 1or? Contro:s

Co%bo ,o" ) - Continued


"7eci9y 8o< ?any co:u?ns are reCuired in t8e co?;o ;o=

Ty7e in t8e >a:ues t8at are to a77ear in t8e co?;o ;o=

continued o;er

CIA Training Ltd 1997

Access 97 Day 2

%&

CIA Course Notes

"ection 1&5 1or? Contro:s

Co%bo ,o" ) - Continued


C:ic@ Ne<t "e:ect to tore t6e ;alue8 and c8oose t8e a77ro7riate 9ie:d

C:ic@ Ne<t Enter a :a;e:

C:ic@ -inis6 "a>e t8e 9or? and try out t8e co?;o ;o= Quick Tip To enter %ore alues into the co%bo bo" once it has been created. Switch to "e$i'! View, select the co%bo bo" and iew its Propertie$. Select the Row Source property. !nter the new alues here separating the% with a se%icolon. Sa e the 1or% and return to For View. The new alues appear.
CIA Training Ltd 1997 Access 97 Day 2 %7

CIA Course Notes

"ection 1&5 1or? Contro:s

Co%bo ,o" 3 6 <i$ard


Co?;o ;o=es can ;e created to 9ind records ;ased on se:ections 9ro? t8e co?;o ;o= W8en creating t8ese co?;o ;o=es it is ;etter to inc:ude t8e 7ri?ary @ey 9ie:d in t8e co?;o ;o= as one o9 t8e co:u?ns O7en t8e 9or? in Design >ie<+ re?o>e t8e 9ie:d <8ic8 is to ;e re7:aced ;y t8e co?;o ;o= Ensure t8e Control 4i5ard is on C:ic@ t8e Co2bo bo< ;utton and dra< t8e co?;o ;o= Note& +t is better to create the combo bo% in the "orm ,eader.

"e:ect -ind a record on 2y >or2%%%%%% C:ic@ Ne<t

"e:ect t8e 9ie:ds to ;e s8o<n in t8e co?;o ;o= and c:ic@ Ne<t continued o;er
CIA Training Ltd 1997 Access 97 Day 2 %*

CIA Course Notes

"ection 1&5 1or? Contro:s

Co%bo ,o" 3 - Continued

ResiBe t8e co:u?n Ei9 necessaryF and unc8ec@ +ide :ey colu2n C:ic@ Ne<t

C8oose t8e 9ie:d <8ic8 uniCue:y identi9ies t8e ro<+ i e t8e 7ri?ary @ey 9ie:d+ t8en c:ic@ Ne<t continued o;er

CIA Training Ltd 1997

Access 97 Day 2

%9

CIA Course Notes

"ection 1&5 1or? Contro:s

Co%bo ,o" 3 - Continued

"e:ect t8e $e2e2ber t6e ;alue8 t8en Ne<t

Enter a :a;e: t8en -inis6

CIA Training Ltd 1997

Access 97 Day 2

&,

CIA Course Notes

"ection 1&5 1or? Contro:s

Co%bo ,o" 6 .anual


Co?;o ;o=es can ;e created <it8out using t8e <iBard O7en t8e 9or? in Design $ie< Ensure t8e Control 4i5ard is turned o99 Re?o>e t8e desired 9ie:d 1ro? t8e Too:;o= c:ic@ on t8e Co2bo ,o< ;utton and dra< a rectang:e in t8e 7osition 9ro? <8ic8 t8e 9ie:d <as re?o>ed A 9ie:d a77ears <it8 t8e <ords un;ound T8is ?eans t8at it is not tied to any 9ie:d in t8e data;ase $ie< t8e Pro1erties :ist 9or t8e te=t ;o= C:ic@ on $o3 ource and t8en t8e ,uild ;utton T8is ;utton <i:: create t8e co?;o ;o= T8e 6o3 Table dia:og ;o= a77ears <it8 a (uery 'rid underneat8 Add t8e ta;:e <8ic8 contains t8e in9or?ation 9or t8e co?;o ;o= C:ic@ Close P:ace t8e 9ie:ds 9or t8e co?;o ;o= on to t8e (uery 'rid in t8e order t8at t8ey are to a77ear in t8e co?;o ;o= Close t8e Cuery grid saying Ges to u7date An e=7ression a77ears in t8e $o3 ource 7ro7erty To store t8e >a:ue in a 9ie:d+ se:ect t8e reCuired 9ie:d 9ro? t8e Control ource 7ro7erty To re?e?;er it 9or :ater use+ i e 9ind a record+ :ea>e t8e Control ource 7ro7erty ;:an@ "a>e t8e 9or? and return to -or2 &ie3 to try out t8e co?;o ;o= Quick Tip /iew the Propert( sheet for the Co%bo bo" to change its properties.

CIA Training Ltd 1997

Access 97 Day 2

&1

CIA Course Notes

"ection 1&5 1or? Contro:s

2ist ,o"es
List ,o<es are >ery si?i:ar to Co?;o .o=es e=ce7t t8e o7tion ?ust ;e c8osen 9ro? t8e gi>en :ist A ne< >a:ues cannot ;e entered O7en t8e -or2 in Design $ie< and de:ete t8e 9ie:d <8ic8 is to ;e re7:aced <it8 t8e List ,o< $ie< t8e Toolbo< and ensure t8e Control 4i5ard is turned on

C:ic@ once on t8e List ,o< ;utton+ and dra< t8e ;o= <8ere it is reCuired T8e List ,o< 4i5ard dia:og ;o= a77ears

Position t8e ?ouse o>er t8e 9or?

1o::o< t8e ste7s t8roug8 in t8e sa?e <ay as 9or t8e co?;o ;o= "a>e t8e 9or? and s<itc8 to -or2 &ie3 to try out t8e List ,o<

CIA Training Ltd 1997

Access 97 Day 2

&2

CIA Course Notes

"ection 1&5 1or? Contro:s

0ption +roups
#1tion 'rou1s a::o< s7eci9ic o7tions to ;e c8osen easi:y 9ro? a 9or? O7en t8e -or2 in Design $ie< I9 reCuired de:ete t8e 9ie:d t8at t8e #1tion 'rou1 is to re7:ace $ie< t8e Toolbo< Ensure t8e Control 4i5ard is turned on

1ro? t8e Toolbo< c:ic@ once on t8e #1tion 'rou1 ;utton rectang:e on t8e 9or? in t8e reCuired 7osition T8e #1tion 'rou1 4i5ard a77ears

and dra< a

Ty7e in t8e :a;e:s t8at are to a77ear in t8e #1tion 'rou1 C:ic@ Ne<t continued o;er

CIA Training Ltd 1997

Access 97 Day 2

&3

CIA Course Notes

"ection 1&5 1or? Contro:s

0ption +roups - Continued


I9 one o9 t8e o7tions is o9ten going to ;e entered into t8e data;ase t8en set it to ;e t8e de9au:t o7tion To do t8is se:ect GesD t6e de>ault is+ c:ic@ on t8e do<n arro< and c8oose t8e ?ost used o7tion I9 not se:ect @No%%%%

C:ic@ Ne<t

T8e ne=t dia:og ;o= s7eci9ies t8e >a:ues t8at are to ;e assigned to t8e c8oices C:ic@ Ne<t <it8out c8anging anyt8ing continued o;er
CIA Training Ltd 1997 Access 97 Day 2 &#

CIA Course Notes

"ection 1&5 1or? Contro:s

0ption +roups - Continued


"7eci9y <8et8er to tore t6e ;alue or a;e t6e ;alue

C:ic@ Ne<t

C8oose a tyle and ty7e o9 ;utton C:ic@ Ne<t continued o;er

CIA Training Ltd 1997

Access 97 Day 2

&%

CIA Course Notes

"ection 1&5 1or? Contro:s

0ption +roups - Continued


1ina::y+ ty7e in a :a;e: 9or t8e o7tion grou7

C:ic@ -inis6 to create t8e #1tion 'rou1 "a>e t8e 9or? and s<itc8 to -or2 $ie< Try out t8e #1tion 'rou1

Quick Tip Create an 1ptio! )roup without using the <i$ard by drawing an 1ptio! )roup, , and choosing a $t(le of button. To''le *utto! Check *utto! 1ptio! *utto!

/iew the Propertie$ for the buttons and ensure the "efault Value$ are correct.

CIA Training Ltd 1997

Access 97 Day 2

&&

CIA Course Notes

"ection 1&5 1or? Contro:s

Tab Control
A ta; contro: can ;e used to s7:it t8e 9or? into di99erent 7ages O7en t8e 9or? in design >ie< and ensure t8e Too:;o= is >isi;:e

1ro? t8e Toolbo< c:ic@ on t8e Tab Control ;utton+ 9or? <8ere t8e ta; contro: is reCuired

+ and c:ic@ on t8e

Add t8e 9ie:ds in t8e usua: <ay To c8ange to anot8er ta;47age c:ic@ t8e ta; Insert ?ore ta;s ;y rig8t c:ic@ing on one o9 t8e ne< ta;s+ t8en c8oose "nsert Page 9ro? t8e ne< ?enu C8ange t8e ta; na?es ;y dou;:e c:ic@ing on t8e na?e and entering t8e ne< te=t into t8e Na2e 7ro7erty ;o= "a>e t8e 9or? and s<itc8 to -or2 ;ie3 to see t8e ta; contro:

CIA Training Ltd 1997

Access 97 Day 2

&7

CIA Course Notes

"ection 1&5 1or? Contro:s

Su%%ary
Create Ca:cu:ated Contro:

Create Co?;o .o=es

Create List .o=

Create an O7tion !rou7

Create O7tion .uttons Create a Ta; Contro:

CIA Training Ltd 1997

Access 97 Day 2

&*

CIA Course Notes

"ection 175 1or? Pro7erties

Section 1> 1or% #roperties

.y t8e end o9 t8is "ection you s8ou:d ;e a;:e to5 'nderstand 1or? Pro7erties "et4C8ange 1or? Pro7erties

CIA Training Ltd 1997

Access 97 Day 2

&9

CIA Course Notes

"ection 175 1or? Pro7erties

1or% #roperties
-or2 Pro1erties are used to set 8o< a -or2 <i:: <or@ Eac8 9or? created can ;e set to 8a>e di99erent 7ro7erties O7en t8e 1or? in Design &ie3 To se:ect t8e 1or? c:ic@ on t8e "e:ect 1or? ;utton in t8e to7 :e9t corner

"e:ect 1or?

C:ic@ t8e Pro1erties ;utton to >ie< t8e 7ro7erty s8eet 9or t8e 9or? "e:ect All i9 not a:ready se:ected T8ese 7ro7erties contro: t8e <8o:e o9 t8e 9or? "cro:: t8roug8 t8e :ist to >ie< t8e o7tions

Pro7erty "et

Pro7erties

To >ie< t8e di99erent sets o9 7ro7erties to ;e >ie<ed se:ect 9ro? t8e 7ro7erty set :ist C:ic@ t8e Pro1erties ;utton again to re?o>e it

CIA Training Ltd 1997

Access 97 Day 2

7,

CIA Course Notes

"ection 175 1or? Pro7erties

4ata #roperties
T8e Data Pro7erties deter?ine 8o< t8e data is s8o<n <it8in t8e 9or? C8ange t8ese o7tions to deter?ine i9 t8e data can ;e a:tered <8en it is ;eing >ie<ed "e:ect t8e 9or? and >ie< t8e Pro1erties 1ro? t8e Pro1erty et se:ect Data

$ecord ource 9or? is ;ased on -ilter 9i:tered

T8is s8o<s t8e ta;:e <8ic8 t8e

"7eci9ies i9 t8e in9or?ation can ;e

Allo3 !dits "7eci9ies i9 t8e data can ;e c8anged Allo3 Deletions "7eci9ies <8et8er records can ;e de:eted 9ro? t8e 9or? Allo3 Additions "7eci9ies i9 ne< records can ;e added >ia t8e 9or? Data !ntry "7eci9ies i9 on:y ne< records can ;e added >ia t8e 9or? $ecord LocEs C8ange t8e o7tions to suit "ets ta;:e o7tions 9or editing data

CIA Training Ltd 1997

Access 97 Day 2

71

CIA Course Notes

"ection 175 1or? Pro7erties

1or%at #roperties
No< se:ect t8e 1or?at ta; 9or?atted T8ese s7eci9y 8o< t8e 9or? is designed and

Ca1tion tit:e

Enter te=t <8ic8 is to a77ear as t8e 9or? >ie< to s8o<

De>ault &ie3"ets t8e standard in9or?ation 9or t8e 9or?

ingle -or2 <i:: s8o< one record at a ti?e Continuous -or2s s8o<s ?any records at a ti?e Datas6eet &ie3 s8o<s a:: records ETa;:e >ie<F &ie3s Allo3ed "7eci9ies <8ic8 o9 t8e >ie<s can ;e used i e 1or? and Datas8eet+ 1or? on:y or Datas8eet on:y croll ,ars "7eci9ies <8ic8 scro:: ;ars to ;e >ie<ed $ecord electors se:ectors "et to dis7:ay48ide record

Na;igation ,uttons "et to dis7:ay48ide Na>igation .uttons Di;iding Lines 9or? >ie< Create a :ine ;et<een records in

Auto $esi5e ResiBe 9or? auto?atica::y to s8o< a 9u:: record Auto Centre Centre 9or? auto?atica::y

CIA Training Ltd 1997

Access 97 Day 2

72

CIA Course Notes

"ection 175 1or? Pro7erties


,order tyle "et .order "ty:e 9or 1or? Control ,o< $ie< t8e Contro: .o= .in=.a< ,uttons $ie< ;utton t8e (ini?iBe4(a=i?iBe

Close ,utton $ie< t8e C:ose ;utton

CIA Training Ltd 1997

Access 97 Day 2

73

CIA Course Notes

"ection 175 1or? Pro7erties

0ther #roperties
Ot8er 7ro7erties t8at can ;e a:tered

Po1 )1 Creates a 9or? t8at <i:: a:<ays stay on to7 o9 ot8er 9or?s .odal 1or? stays in >ie< unti: c:osed

Cycle 0o< ta; @ey <or@s on 9or? <8en ?o>ing ;et<een 9ie:ds .enu ,ar Attac8 a (enu ;ar to t8e 9or? Toolbar Attac8 Too:;ar to use <it8 t8e 9or? "7eci9ies use o9 rig8tAc:ic@ ?enu o7tions

6ortcut 2enu

CIA Training Ltd 1997

Access 97 Day 2

7#

CIA Course Notes

"ection 175 1or? Pro7erties

Su%%ary
C8ange 1or? Pro7erties -or2s 9 Design 9 Pro1erties

CIA Training Ltd 1997

Access 97 Day 2

7%

CIA Course Notes

:nde"
&utoReport 2 Calculated Field$ 34 Co #o *o5 6, Cut7 Cop( a!d Pa$te
Records 10

Para eter Querie$ ;8 Propertie$


4ata >0 1or% =? 1or%at >1 0thers >)

"ata Propertie$ 28 Field Propertie$


4efault /alue 33 1or%at 3)

Relatio!$hip$ ;9
4elete )= !dit )>

Replace Te5t ,, Report$


&utoReport > Create ) !dit 5 #re iew ; #rint =

For at
1ield #roperty 3) #roperties >1

For $
2inking 53 .ultiple Table 5; #roperties =? Sub1or% 3?

Su#For

9<

Ta# Co!trol :: Validatio! Rule$ 93 %i0ard$


Co%bo ,o" ;1, ;5, ;> Co%%and ,uttons 5? Control 5) .ain ' Subfor% 50

.!put /a$k 96 Querie$


&nd 1> & erage 1= Calculated 1ields )0 Count 1; +roup by 1; .a"i%u% 1= .ini%u% 1= 0r 1> #ara%eter )0

+i!ki!' For $ 39 +i$t *o5e$ :, 1ptio! )roup$ :;

CIA Training Ltd 1997

You might also like