You are on page 1of 22

The Characteristics of a Form

Anatom y of a For m
The Object's Tab
Rem em ber t hat , w hen displaying dat a t o a user, t he form show s in Form View, if you are designing, or m odifying t he design of, a form , you m ust display it in Design View. I n som e case, whet her in For m View or in Design View, a form is repr esent ed by a t ab t hat displays an icon .

Pr actical Lear ning: I ntr oducing For m s and Repor ts' Pr oper ties
1. St art Micr osoft Access and open t he H ot e l M a n a ge m e nt 1 dat abase you st art ed in t he pr evious lesson 2. To creat e a new for m , on t he ribbon, click Cr eat e and, in t he Form s sect ion, click Blank For m 3. To save t he new form , right - click t he Form 1 t ab and click Save 4. Set t he nam e t o Ce n t r a l and press Ent er 5. To swit ch t he form t o Design View, on t he r ight side of t he st at us bar, click t he Design View but t on 6. To access t he proper t ies of t he form , doubleclick t he but t on at t he int ersect ion of t he r uler s

The Caption of a For m


On t he r ight side of it s icon , by default , a for m displays it s nam e. I n r ealit y, t he st r ing on t he right side of t he icon is called t he capt ion of t he form . The capt ion of a for m is r ecognized by t he Ca pt ion pr opert y. I f you do not specify t he capt ion, t he t it le bar of a form displays it s nam e. To specify t he capt ion of a form , access it s Proper t ies w indow and, in t he Form at or t he All t ab, click Ca pt ion and t ype t he desired st r ing.

Pr actical Lear ning: Specifying the Caption of a For m


1. I n t he Proper t ies window of t he form , click t he For m at t ab and click Capt ion 2. Type M a in Sw it ch boa r d and press Ent er 3. To save t he for m , press Ct rl + S

Tabbed Docum ents or Over lapped W indows?


We m ent ioned t hat a for m w as represent ed in it s t op sect ion by a t ab. When a form displays w it h a t ab, t he right sect ion of t he t ab( s) displays a close but t on t hat you can use t o close t he for m . I f you w ant , you can replace t he t ab of a form and let t he form display wit hout t he t ab. To do t his, click t he Office But t on and click Access Opt ions. I n t he left fr am e of t he Access Opt ions dialog box, click Current Dat abase. I n t he right fram e and in t he Docum ent Window Opt ions sect ion, click t he Tabbed Docum ent s r adio but t on and rem ove t he check m ark on t he Display Docum ent Tabs check box, t hen click OK. On t he m essage box t hat appear s, click OK. Close and r eopen t he dat abase. By default , a for m displays w it h a t ab, in w hich case t he user cannot m ove it . Ot her wise, a for m can appear as a r egular w indow wit h it s syst em but t ons. To t ake care of t his, you can click t he Office But t on and click Access Opt ions. I n t he left fram e, you can click Curr ent Dat abase and, in t he r ight fram e, in t he Docum ent Window Opt ions sect ions, click

t he Over lapping Window s radio but t on:

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.

The Contr ol Box


I f you display a for m as overlapped, it w ould be equipped w it h t hree syst em but t ons , . Here is an exam ple: , or

The gr oup of t hese but t ons is called t he Con t r ol Box . I f you do not want t hese syst em but t ons at all, access t he Proper t ies window of t he form and set t he Con t r ol Box Boolean proper t y t o N o from it s Ye s default value. I n t his case, t he for m w ould appear w it h neit her t he syst em icon nor t he syst em but t ons. I f you do t his, m ake sur e t he user has a way t o close t he for m .

The M in/ M ax Buttons


I nst ead of com plet ely hiding all syst em but t ons of a form , you can specify w hich ones t o display and t hus cont rol t he abilit y t o close, m inim ize, or m axim ize t he form . The presence and/ or t he role of t he syst em but t ons is ( par t ly) m anaged by t he Cont rol Box and t he M in M a x Bu t t ons propert ies. When t he Con t r ol Box pr opert y is set t o N o , r egar dless of t he value of t he M in M a x But t ons proper t y, t here would be no syst em but t ons on t he t it le bar. I f you w ant t o cont rol t he appear ance and behavior of t he syst em but t ons, t he Con t r ol Box pr opert y m ust be set t o Yes . The values of t he M in M a x Bu t t ons produce t he follow ing r esult s: M in M a x But t ons None Min Enabled Max Re su lt Syst e m Bu t t on s M in im iz e M ax im ize Hidden Enabled Hidden Disabled Close Con se qu e nce

Available The form can only be closed Available The form can be m inim ized or closed but not m axim ized The form cannot be

Enabled Bot h Enabled

Disabled Enabled

Enabled Enabled

Available

m inim ized but can be m axim ized

All oper at ions ( m inim ize, Available m axim ize, rest or e, and close) are allow ed

Depending on t he role and pr obably t he num ber of Windows cont rols on a for m , you will decide w hat but t on t o allow or not .

Pr actical Lear ning: Accessing the System Buttons of a For m


1. Click t he Office But t on and click Access Opt ions 2. I n t he left fram e, click Cur rent Dat abase 3. I n t he r ight fr am e, in t he Docum ent Window Opt ions, click t he Over lapping Windows r adio but t on 4. Click OK 5. On t he Microsoft Office Access m essage box, click OK 6. Close Microsoft Access 7. Rest ar t Microsoft Access and re- open t he Hot el Managem ent 1 dat abase 8. To r eopen t he Cent ral for m , in t he Navigat ion Pane, right - click Cent r al and click Design View

The For m s Bor der s


Whet her you allow t he syst em icon and syst em but t ons or not , t he user needs t o be able t o know wher e a form st ar t s and w here it ends. This is seen by t he borders of t he form . I n m ost cases, you w ill not be concerned wit h t his aspect . Ot her wise, you can cont rol t he border s of a form . The bor ders of a form are cont rolled using t he Bor de r St y le pr opert y. I f you set it t o N on e , t he for m would appear wit hout borders.

For m Layout
The m ain area of t he for m is w hat t he user will m ost ly use. This is also r efer red t o as t he body of t he form . I f you creat e a for m using t he Form Wizar d , it ( t he w izard) can assist you w it h deciding how t he obj ect s in t he body of t he for m would display. Form s can be designed in various flavors: Colum n a r , D a t a she e t , Tabu la r , Ju st ifie d :

A colum nar for m is used t o display dat a one recor d at a t im e. This is a convenient display for dat a ent ry and analysis because t he user is able t o exam ine each piece of inform at ion for each one r ecor d:

A t abular form displays it s dat a in a ser ies of cells follow ing cont inuous set s of records. All or alm ost all r ecor ds are displaying in a single layout :

To creat e a t abular form , use t he Form Wizar d and select it s opt ion. Ot her wise, you can design a fr om fr om scr at ch. Then, in t he For m at or t he All t abs of t he Proper t ies window , set it s D e fa ult Vie w t o Con t in u ous For m

A Dat asheet for m looks and behaves like a t able, displaying all possible r ecor ds at t he sam e t im e inst ead of one record at a t im e. A dat asheet form is m ainly used in relat ionships t o display anot her t able's relat ed records. I t is also suit able for people w ho prefer t o wor k in a spreadsheet envir onm ent . This display allows t he dat abase developer t o provide a sheet view t o t he dat a ent ry personnel wit hout m aking t he t able's design or form at s available. You can m ake t he sam e form available in Form View and Dat asheet View . I n fact , m ost form s ar e. User s can sw it ch from Form View t o Dat asheet View by clicking t he View m enu. To creat e a Dat asheet form , use t he For m Wizard and select it s opt ion. You can also design a from from scrat ch. Then, in t he For m at or t he All t abs of t he Propert ies w indow , set it s Default View t o Dat asheet

A Just ified for m provides a consist ent look w it h bor ders added t o labels A split form is m ade of t wo sect ions. The t op sect ion displays like a norm al Form View and show s one r ecord at a t im e. The bot t om sect ion displays a dat asheet view of ( all) t he r ecor ds ( if t he area is big enough) :

When using t he split for m , if you click a record in t he bot t om sect ion, it s values display in t he t op sect ion.

To aut om at ically gener at e a split form , in t he Navigat ion Pane, click t he t able t hat holds t he records. Then, on t he Ribbon, click Cr eat e. I n t he For m s sect ion, click Split Form . To cr eat e a split for m by design, st ar t a for m in Design View or display an exist ing for m in Design View . I n t he Propert ies w indow of t he form , set it s Recor d Source t o t he t able t hat holds t he value and set it s Default Value t o Split Form . I f it is bran new form wit hout som e previously cr eat ed fields, use t he Field List t o add t he desir ed fields t o it .

The Sections of a For m


The Detail Section
When it com es up, a for m is present ed as a r ect angular box. A form in Design View is m ade of a form select ion but t on, t w o r ulers, t wo scroll bar s, a hor izont al bar labeled Det ail, and a body. By default , a for m pr esent s a sect ion refer red t o as t he Det ail sect ion. This sect ion st art s from t he Det ail bar t o t he low er end of t he sect ion. The Det ail bar displays only w hen t he for m is in Design View.

The For m H eader and the For m Footer


Besides t he Det ail sect ion, a for m can be equipped w it h a sect ion on t op and anot her sect ion in it s bot t om part . To add t hese sect ions, you can:

Right - click t he m iddle of t he for m and click For m H e a de r / Foot e r On t he ribbon, you can click Arrange and, in t he Show / Hide sect ion, click t he For m H e a de r / Foot e r but t on

Any of t hese t wo act ions w ould add t wo new sect ions t o t he for m : t he For m Header sect ion on t op and t he Form Foot er sect ion at t he bot t om :

Alt hough t w o sect ions are added, you can reduce one com plet ely so it w ould not appear t o t he user . This m eans t hat you can keep one sect ion and hide t he ot her. I f you creat e a form using t he For m Wizard, bot h t he header and t he foot er sect ions are added but t he foot er sect ion is com plet ely reduced so it would not appear t o t he user. I f you want t o display it t o t he user , you m ust expand it .

Pr actical Lear ning: Cr eating the Sections of a For m


1. While t he form is st ill displaying in Design View, on t he ribbon, click Arrange if necessary. I n t he Show/ Hide sect ion, click t he For m Header/ Foot er but t on 2. Save t he form

The Page H eader and the Page Footer


A form can also be equipped w it h t w o ot her sect ions. To get t hem , you can:

Right - click t he m iddle of t he for m and click Pa ge H e ade r / Foot e r I n t he Show/ Hide sect ion of t he Ar range t ab of t he ribbon, you can click t he Pa ge H e a de r / Foot e r but t on

Any of t hese act ions w ould add t w o new sect ions t o t he for m : a Pa ge H ea de r and a For m H ea de r sect ions. These sect ions would not appear t o t he user. They appear only if t he user decides t o print a form , in w hich case t hey w ould appear on t he pr int ed paper. Like t he form sect ions, you can use eit her one or bot h t he Pa ge H e a de r and t he Pa ge Foot e r sect ions

D ividing Lines
A for m is equipped w it h special horizont al lines used t o visually separ at e sect ions of a for m . They do not per for m any ot her special act ion. To equip a for m w it h dividing lines, add a header and a foot er sect ions. I f you creat e a form t hat is direct ly equipped wit h a header and a foot er sect ions, it w ould display t he dividing lines. The presence or absence of t he horizont al lines is cont rolled by t he Boolean D ividin g Lin e s propert y. I f you set it s value t o Yes , t he dividing hor izont al lines would display on t he form . To hide bot h lines, you can set t his pr opert ies value t o N o . To hide an individual line, you can com plet ely r educe it s sect ion.

Pr actical Lear ning: U sing D ividing Lines


1. On t he for m , double- click t he but t on at t he int er sect ion of t he ruler s. I n t he Proper t ies window , click t he Form at t ab and set t he D ividing Lin es field t o Yes 2. Save t he form

The Recor ds of a For m


The For m 's Scr oll Bar s
As m uch as you can, you should design your ( non - Dat asheet ) form t o display all of t he fields of a r ecor d w henever t he/ a record com es up. Som et im es t his w ill not be possible. I f a form possesses t oo m any fields for each record, Micr osoft Access would equip t he for m w it h one or t w o scroll bar s. A scroll bar allows t he user t o scroll from one side of t he for m t o anot her. The ver t ical scroll bar is used t o scr oll up and down while t he horizont al scroll bar allows scrolling left and right :

By default , scroll bars com e up if t he form "j udges" t hem necessar y, such as if som e fields, or som e ar ea of som e fields, ar e hidden. The pr esence of scr oll bar s allow s t he user t o be aware of hidden fields. Depending on your design, you can cont r ol t he appearance or disappearance of t he scroll bars. To do t his, change t he values of t he Scroll Ba r s field in t he For m at pr opert y page. Ther e ar e four possible values. To display only t he vert ical scroll bar, set t he value t o Ve r t ica l Only :

I n t he sam e w ay, you can display only t he horizont al scr oll bar by select ing H or izon t a l Only . On t he ot her hand, you can display bot h scroll bars by set t ing t he value t o Bot h . I f for som e reason you do not want any scr oll bar, set t he Scr oll Ba r s proper t y value t o N e it he r .

The Recor d Selector s


A form is equipped w it h a special ar ea t hat allow s you t o select a record. This area is called t he Recor d Select or. The Record Select or is on t he left side im m ediat e t o t he left side of a record on t he form . I t s size depends on t he t ype of r ecord. For a regular for m ( Single For m ) , t he r ecor d select or is t he long ver t ical box on t he left of all r ecor ds:

On a dat asheet form , a t abular form , or t he dat asheet sect ion of a split form , t he r ecor d select or is t he box on t he left side of each individual record. This m eans t hat t he view of t he form can display m any r ecord select ors, one for each record. I n t he following scr eenshot , t he record select or of each r ecor d is t he blue box on it s left :

I f you do not want a form t o display t he record select or( s) , in it s Design View, set it s Re cor d Se le ct or s pr opert y t o N o .

Pr actical Lear ning: H iding the Contr ol Selector s


1. I n t he Proper t ies window , click t he Form at t ab and double- click Re cord Se le ct or s t o set it s value t o N o 2. Save t he form 3. To pr eview t he form , on t he r ight side of t he st at us bar, click t he Form View but t on 4. To r et urn t o Design View, right - click t he t it le bar of t he Cent ral for m and click Design View

N avigation Buttons
I n t he bot t om sect ion, a form is equipped wit h t he sam e navigat ion but t ons used on t ables. These but t ons ar e useful only if t he form is m eant t o display dat a. The but t ons ar e available if t he for m is displayed in a view ot her t han t he Design View . I f you do not w ant a form t o display t he navigat ion but t ons, set it s N a viga t ion But t ons propert y t o N o .

Pr actical Lear ning: Configur ing the N avigation Buttons


1. I n t he Form at t ab of t he Proper t ies window , double- click N a v iga t ion Bu t t on s t o set it s value t o N o 2. To pr eview t he form , right - click t he Cent ral t ab and click t he Form View but t on 3. To r et urn t o Design View, on t he right side of t he st at us bar Form View 4. Save t he form

N avigation Caption
By default , a for m is equipped w it h a st at us bar or navigat ion bar. On t he left side of t he bar, it displays t he Re cor d: label. I f you want , you can change t hat st ring t o a short one of your choice. To change t he t ext on t he left side of t he navigat ion bar , in t he Proper t ies window of t he form , click t he For m at t ab and, in t he N a v iga t ion Ca pt ion field, ent er a st r ing of your choice. Here is an exam ple of a result ( not ice t he Navigat ion st ring on t he lower - left side of t he bot t om bar) :

The Size of a For m


The W idth of a For m
The w idt h of a form is t he dist ance from it s left border t o it s r ight border . The w idt h of a form is t he com m on widt h of each one of it s sect ions. All sect ions use t he sam e widt h. To w iden or nar row a for m , posit ion t he m ouse on t he r ight border of one of it s sect ions. The m ouse cur sor w ould t ur n int o a vert ical line wit h a horizont al double arrow :

You can t hen click and dr ag right t o widen or left t o nar row t he form . The widt h of a form is a num eric value. To change it s value w it h m ore precision, access t he Proper t ies window of t he form . I n eit her t he Form at or t he All t ab, click t he W idt h field, t ype a decim al value and pr ess Ent er.

Pr actical Lear ning: Changing the W idth of a For m

1. Double- click t he but t on at t he int er sect ion of t he ruler s. I n t he Form at t ab of t he Proper t ies window , click W idt h 2. Type 4 .5 and pr ess Ent er

The H eight of a For m


The height of a for m is cont r olled by it s sect ions. For t his r eason, each sect ion cont r ols it s ow n height . The t ot al height s of all sect ions const it ut e t he height of t he for m . Based on t his, t o resize a form , you m ust act ually r esize one or som e of it s sect ions. To height en a sect ion on a form , posit ion t he m ouse on t he lower port ion of t he sect ion. For t he headers or t he Det ail sect ions, t hat w ill be t he upper border of t he lower bar. For t he lowest sect ion, t he m ouse m ust be posit ioned on t he low er border . The cursor t ur ns int o a narrow horizont al line wit h a vert ical double- arr ow:

The height is a num eric value. As m ent ioned already, each sect ion of a for m cont rols it s ow n height . Based on t his, t o num erically change t he height of a sect ion of a form , access t he Proper t ies w indow of t hat sect ion. I n eit her t he For m at or t he All t ab, click t he H e igh t field, t ype a decim al value and press Ent er . This also m eans t hat , t o set t he t ot al height of a for m , you can change t he H e igh t value of each sect ion.

Pr actical Lear ning: Changing the H eight of a For m


1. On t he for m , double- click t he For m Header bar 2. I n t he Form at t ab of t he Proper t ies window , click H e ight and t ype .5 3. On t he for m , click t he Det ail bar 4. I n t he Form at t ab of t he Proper t ies window , click H e ight and t ype 2 .5 5. On t he for m , click t he Form Foot er bar 6. I n t he Form at t ab of t he Proper t ies window , click H e ight and t ype .3 5 and press Ent er 7. Save t he form

Both the W idth and H eight of a For m


To change bot h t he widt h and t he height of a for m at t he sam e t im e, you can posit ion t he m ouse on t he lower - right cor ner. The cursor would change int o a sm all squar e w it h 4 arr ows:

You can t hen click and dr ag left , r ight , up, dow n, or diagonally. To num erically change t he w idt h and t he height of a form , change t he value of t he Widt h of t he form . Then change t he Height values of t he individual sect ions.

Autom atically Center ing a For m


When you open a for m from t he Navigat ion Pane, t he obj ect is posit ioned from t he t op - left cor ner of t he gr ay area of Microsoft Access. I f you want t he form t o be aut om at ically cent ered, access it s Pr opert ies window and, in t he For m at or t he All t ab, set it s Au t o Cen t e r Boolean propert y t o Yes fr om it s default N o value.

Fitting the Scr een


While designing a form , you m ay st r et ch it s right and/ or it s bot t om bor ders beyond t he act ual borders of t he form . Consider t he following screenshot :

When you pr eview t he form , it would appear w it h t he expanded size, which is not t he act ual size of t he form . The above form w ould pr oduce:

When t he for m is previewed, t o get it s act ual size, on t he r ibbon, click Hom e. I n t he Window

sect ion, click t he Size To Fit Form

The Backgr ound Pictur e of a For m


I ntr oduction
Except when w e used t he For m Wizard, all of t he form s w e had cr eat ed so far had a w hit e background. I f you want , you can cover a form wit h a pict ur e. Micr osoft Access pr ovides a few pict ures but you can also use a pict ure of your ow n. To use a pict ur e as a background, aft er accessing t he pr opert ies of t he form , in t he Form at or t he All t ab, you can click Pict u r e and click it s brow se but t on. This w ould open t he I nsert Pict ure dialog box t hat allows you t o locat e and select a pict ure. Microsoft Access support s all t he popular pict ur e form at s, including BMP, JPEG, GI F, and PNG. Aft er select ing t he pict ur e, you can click OK. Because t he Pict ure pr opert y ( unfort unat ely) belongs t o t he for m and not t o one of it s sect ions, t he pict ure you use would cover all sect ions of t he for m .

Obviously before using a pict ur e, you should design or be very fam iliar w it h it . This is because you m ay want one sam ple of t he pict ure t o cover t he whole form . Here is an exam ple:

This would produce:

Pr actical Lear ning: Setting the Backgr ound of a For m


1. Fr om t he r esources t hat accom pany our lessons, open t he D a n ilo Pizza 1 dat abase 2. I n t he Navigat ion Pane, under Pizza Or ders: Table, double- click ( t he) Pizza Or ders ( form ) t o open it 3. Aft er view ing t he for m , t o change it s view , right - click it s t ab and click Design View 4. Double- click t he but t on at t he int er sect ion of bot h r ulers t o access t he proper t ies of t he form . I n t he Proper t ies window , click t he Form at t ab and click Pict u r e 5. Click t he ellipsis but t on of t he Pict ure propert y. I f you receive a Micr osoft Office Access Secur it y Not ice, r ead it and click Open 6. Save t he form

Linking or Em bedding the Pictur e


Aft er adding a pict ur e t o a for m as it s backgr ound, by default , t he pict ur e becom es par t of t he dat abase. This is refer red t o as em bedding t he pict ur e. The advant age is t hat , if/ when you dist r ibut e t he dat abase, t he pict ur e would be added also and you do not have t o w orry about shipping it w it h t he dat abase. The disadvant age is t hat , ( if you add m any pict ur es like t hat ) t he dat abase file get s lar ger and larger . Microsoft Access provides an opt ion. I nst ead of em bedding t he pict ure, you can provide a link t o it so t hat , w henever t he form is opened, it would connect t o t he locat ion of t he pict ure and show it . The advant age is t hat , because only a link is provided, w hich is sim ple t ext , t he dat abase cannot grow because of t he pict ur e. The disadvant age is t hat , if/ w hen you dist r ibut e your dat abase, you m ust rem em ber t o also ( separ at ely) ship t he pict ur e and you m ust m ake sure t he form can find t he pict ure ever y t im e it is opened. The em bedding or linking char act erist ic is cont r olled by t he Pict u r e Type enum er at ed pr opert y w hose t wo values are Em be dde d ( t he default ) and Link e d :

I f you set t he Pict ur e Type t o Lin k ed , t he file nam e of t he pict ure ( w it h it s ext ension) w ould be set as t he value of t he Pict u r e proper t y I f you set t he Pict ur e Type t o Em bedded, you w ould be asked t o first r em ove t he value of t he Pict u r e proper t y. You m ust specify t he pict ure again. This t im e, t he ( whole) pat h of t he file nam e would be set as t he value of t he Pict ur e pr opert y.

The Pictur e Alignm ent


I n som e cases, you m ay w ant t o use a pict ure sm aller t han t he form . Here is an exam ple:

I f you use a pict ur e t hat is sm aller t han t he for m , by default , t he pict ure w ould be posit ioned in t he m iddle of t he form . This char act erist ic is cont rolled by t he Boolean Pict u r e Align m e nt propert y w hose default value is Cent er . I f you want t he sm aller pict ur e t o be posit ioned in one of t he sect ions, select anot her value fr om t his propert y. I f you select :

Top Le f t : I f t he form has only a Det ail sect ion, t he pict ure w ould be posit ioned from under t he Form Header bar but t o t he left side of t he sect ion. I f t he pict ure is t aller t han t he Form Header sect ion, it w ould span dow n t o t he Det ail sect ion

I f you want such a pict ure t o display only in t he Form Header sect ion, when designing it , m ake it shor t er and set t he height of t he For m Header sect ion accordingly

Top Righ t : I f t he form has only a Det ail sect ion, t he pict ur e w ould be posit ioned from under t he For m Header bar but t o t he right side of t he sect ion.

I f t he pict ure is t aller t han t he Form Header sect ion, it w ould span dow n t o t he Det ail sect ion. I f you want such a pict ure t o display only in t he For m Header sect ion, w hen designing it , m ake it as t all as t he int ended height of t he For m Header sect ion

Cen t e r a nd For m Ce nt er : The pict ure would be posit ioned in t he m iddle of t he Det ail sect ion Bot t om Le ft : I f t he for m has only a Det ail sect ion, t he pict ure would be posit ioned above t he Form Foot er bar t o t he left side of t he sect ion. I f t he pict ure is t aller t han t he Form Header sect ion, it w ould span up t o t he Det ail sect ion

I f you want such a pict ure t o display only in t he Form Foot er sect ion, design it and m ake it as t all as t he event ual height of t he For m Header sect ion

Bot t om Right : I f t he for m has only a Det ail sect ion, t he pict ure would be posit ioned above t he Form Foot er bar t o t he r ight side. I f t he pict ure is t aller t han t he Form Header sect ion, it w ould span up t o t he Det ail sect ion. I f you want t he pict ure t o display only in t he Form Foot er sect ion, when designing it , m ake it as t all as t he height you will specify for t he For m Header sect ion

Pr actical Lear ning: Aligning the Backgr ound


1. Set t he Pict u re Alignm e nt t o Top Le ft 2. Save and preview t he form

3. Close t he form

Tiling the Pictur e


I f you want t o use a pict ur e sm aller t han t he for m but have it repeat it self on t he for m , t his

charact er ist ic is refer red t o as t iling. To m ake t his happen, in t he For m at or t he All t ab of t he Proper t ies w indow, set t he Pict u r e Tiling Boolean propert y t o Ye s . Consider t he following exam ple:

I f you set t he Pict u r e Tilin g propert y t o Yes , t his would produce:

Zoom ing or Str etching a Pictur e


I f you did not pay at t ent ion when designing t he pict ure or if you got it from som ebody, aft er specifying it as t he background of t he form , you m ay find out t hat eit her it is t oo narrow , t oo w ide, t oo shor t , or t oo t all for t he form . Ther e ar e various ways you can m anage t his sit uat ion. One of t he opt ions you have is t o cont rol t he size m ode t hr ough t he Pict u r e Size M ode propert y. Consider t he following exam ple:

Pict u r e Size M ode is an enum erat ed pr opert y w hose values are:

Clip : This is t he default value. I t s effect depends on t he Pict ure Alignm ent and t he Pict ur e Tiling proper t ies St r e t ch : When t his opt ion is select ed, t he pict ure size would be expanded so t hat it s corners ( t op- left , t op- right , bot t om - r ight , and bot t om - left ) t ouch t he cor ner s of t he form . Here is an exam ple:

I f t he form is resized, t he backgr ound pict ur e would be st ret ched so it s corners are t he sam e as t hose of t he for m . Her e is an exam ple of t he above for m resized:

St r e t ch H or izon t a l : When t his opt ion is select ed, t he pict ure would be expanded horizont ally so t hat it s left border t ouches t he left border of t he form and t he r ight border of t he pict ure w ould t ouch t he r ight border of t he for m . I f t he for m is r esized, t he backgr ound pict ure w ould be st ret ched also. I t s left and right bor ders w ould st ill t ouch t he left and r ight borders of t he form St r e t ch Ve r t ica l : I f t his value is set , t he pict ur e w ould be height ened or short ened so it s t op border t ouches t he t op border of t he for m and t he bot t om bor der of t he pict ur e would t ouch t he bot t om border of t he for m . I f t he for m is r esized, t he pict ur e w ould be st ret ched also: it s t op and bot t om borders would cor respond t o t he t op and t he bot t om borders of t he form Zoom : To st art , Micr osoft Access would get t he height and t he widt h of t he pict ure, t hen it w ould calculat e t heir rat e t o get a fr act ion such as 1/ 2, or 3/ 4, or 7/ 5, et c. When t his opt ion is select ed, t he pict ure would be st r et ched propor t ionally using t he calculat ed r at e. When st ret ching, once a border of a pict ur e r eaches a border of t he for m , t he ot her border w ould not be st r et ched anym or e. As a consequence, if t he r at e of t he dim ensions of t he form is not t he sam e as t he rat e of t he dim ensions of t he pict ur e, t wo sides of t he for m would not be covered. Consider t he following:

Not ice t hat t he pict ure is squar e, which m eans t he rat e of it s height and widt h is 1. The form is rect angular, w hich m eans t he rat e of it s height and w idt h is differ ent t han 1. I f you set t he Pict u r e Size M ode proper t y t o Zoom , you w ould get t he following result :

I f you resize t he form , t he pict ure also m ay be st ret ched but it w ould keep t he r at e of it s height / widt h.

Char acter istics of the Sections of a For m


The Backgr ound Color of a Section
I n all form s we have creat ed so far , unless using t he For m Wizard or occupying it w it h a pict ure, t he body of t he form w as paint ed wit h a w hit e color . I f you do not enj oy w hit e form s, you can set t he backgr ound t o a color of your choice. Unlike t he pict ur e, t he form ( fort unat ely) does not cont rol it s background color. This aspect is left t o each sect ion t o m anage. Before specifying t he color of a for m , fir st click or select t he int ended sect ion. To change t he background color of a sect ion:

On t he ribbon, click Hom e and, in t he Font sect ion, select a color fr om t he Fill/ Ba ck Color but t on Right - click a sect ion, posit ion t he m ouse on Fill/ Back Color and click t he desired color

On t he ribbon, click Design and, in t he Font sect ion, select a color from t he Fill/ Ba ck Color but t on Access t he Proper t ies window of t he sect ion. I n t he For m at or t he All t ab, click t he Ba ck Color field. I f you click t he arr ow of t he propert y, you can select a fam iliar color from t he list . Ot herw ise, you can click t he br owse but t on. This w ould display a list of colors sim ilar t o t hat of t he Fon t / For e Color w indow

Unlike t he Fill/ Ba ck Color ( and t he Font Color ) of t he Font sect ions of t he Hom e and t he Design cat egor ies of t he ribbon, when you right - click a sect ion of a form and posit ion t he m ouse on Fill/ Ba ck Color , t he color s t hat display do not show t heir t ool t ip, w hich would indicat e t heir nam es. Because t he layout of colors is t he sam e as t he Fill/ Ba ck Color and t he Font Color window s of t he Font sect ions of t he Hom e and t he Design cat egories of he ribbon, w e w ill use t heir nam es.

Pr actical Lear ning: Setting Backgr ound Color


1. The Cent r al form should st ill be opened in Design View . On t he for m , click t he Form Header bar t o select it s sect ion 2. On t he ribbon, click Hom e.

I n t he Font sect ion, click t he arrow of t he Fill/ Back Color but t on 5 ( 4t h colum n - 6t h row )

and select Dark Blue

3. On t he for m , right - click under t he Det ail bar, posit ion t he m ouse on Fill/ Back Color and click Medium Gray 2 ( 3r d colum n - 3rd row) 4. On t he for m , double- click t he sect ion under t he For m Foot er bar 5. I n t he Proper t ies window , click t he Form at bar and click Back Color 6. Click t he arrow of t he field and select Background Form 7. To save t he for m , press Ct rl + S

Special Effects
Micr osoft Access pr ovides som e special visual effect s used t o r aise or sink, et c a sect ion of a form or r eport , a label or a field. These effect s can be cont r olled by using t he Spe cia l Effect field in t he Proper t ies window .

Pr actical Lear ning: U sing Special Effects


1. The Cent r al form should st ill be opened in Design View . On t he for m , click t he Form Header bar 2. I n t he Form at t ab of t he Proper t ies window , click Spe cia l Effect and click t he ar row of t he field t o select Raise d 3. On t he for m , click under t he For m Foot er bar 4. I n t he Form at t ab of t he Proper t ies window , double- click Spe cial Effe ct t o set it s value t o Raise d 5. Save t he for m

Autom atic D esign of a For m


M icr osoft Access D esign Tem plates
We saw t hat , w hen you creat e a form using t he For m Wizar d, you have t he opt ion of applying one of t he designs provided by Microsoft Access. I f you cr eat e a form in Design View, you w ould have t he regular design. You can st ill apply one of t he designs supplied by Microsoft Access. To use one of t he pre- designs available in Micr osoft Access

Use t he Form Wizard t o creat e t he form and select a design on t he t hir d page of t he w izar d

I f t he form has been creat ed alr eady, open or display it in Design View. On t he r ibbon, click Ar range. I n t he Aut oFor m at sect ion, click t he Aut oForm at but t on. This w ould display a w indow w it h t he available form at s

Each form at has a nam e t hat appears as a t ool t ip w hen you posit ion t he m ouse on it . To apply one of t he for m at s t o your form , sim ply click it . You can also click t he Aut oForm at Wizar d... but t on and, in t he dialog box, select t he desired design

Display t he form in Layout View. To do t his, in t he Navigat ion Pane, you can right - click t he form and click Layout View. I f t he for m is cur rent ly opened, on t he right side of t he st at us bar, you can click t he Layout View but t on. Once in t he Form Layout View , in t he Aut oForm at sect ion, click one of t he but t ons in t he left sect ion. I f you click t he More but t on, a w indow w ould com e up and would display a window w it h t he pr eview. I f you see a for m at you w ant , you can click it . I f you click t he More but t on, you can t hen click t he Aut oForm at Wizard... but t on and, in t he dialog box, select t he desired design

Cr eating a For m D esign


I f you design a good looking for m and w ant t o use it s design in ot her dat abases, you can add it t o t he list of designs of t he Aut oForm at w indow. To do t hat :

Open or display t he form in Design View . On t he r ibbon, click Arr ange. I n t he Aut oFor m at sect ion, click t he Aut oFor m at but t on and, in t he w indow t hat appear s, click t he Aut oForm at Wizard but t on...

I n t he Aut oForm at dialog box, you can click t he Cust om ize... but t on.

Display t he form in Layout View and, in t he Aut oForm at sect ion of t he Form at cat egory of t he ribbon, click t he More but t on, click Aut oFor m at , and click Cust om ize...

I n t he Cust om ize Aut oFor m at dialog box, you can click t he Creat e A New Aut oFor m at Based

radio but t on and click OK

D ialog Boxes
I ntr oduction
A dialog box is a rect angular obj ect t hat is used t o host or car ry ot her cont rols:

A dialog box is prim arily char act erized by t wo feat ures: it s t it le bar and it s body. The t it le bar, on t op of t he dialog box, can have a t it le and has t he syst em close but t on . Alt hough t his is t he norm al appearance of a dialog box, it is not st r ict ly exclusive. Som e dialog boxes display t he syst em icon. On t he r ight side of t he t it le bar , a classic dialog box displays only t he syst em Close but t on m ade of X. Again, t his is not exclusive. I t is not unusual for a dialog box t o display t he m inim ize and t he m axim ize/ rest or e but t ons. To use a dialog box, t he user m ust open it one w ay or anot her. Your j ob is t o decide how and when t he user w ill be able t o open a dialog box.

Cr eating a D ialog Box


Ther e are various w ays you can creat e a dialog box in Micr osoft Office Access 2007:

To let t he applicat ion gener at e a dialog box for you, on t he Ribbon, click Creat e. I n t he For m s sect ion, click More Form s - > Modal Dialog To creat e t he dialog box yourself, st art a form in Design View . To convert an exist ing form int o a dialog box, set it s Bor de r St yle pr opert y value t o D ia log . This reduces t he syst em but t ons t o t he Close but t on only

Ther e are t w o t ypes of dialog boxes: m odal and m odeless.

Pr actical Lear ning: Cr eating a M odal D ialog Box


1. Fr om t he r esources t hat accom pany t hese lessons, open t he Bet hesda Car Rent al1 dat abase 2. On t he Ribbon, click Creat e and, in t he Form s sect ion, click Form Design 3. Double- click t he but t on at t he int er sect ion of t he ruler s t o access it s pr opert ies. I n t he Proper t ies window , click t he Form at t ab and click Bor der St yle. Then click t he arr ow of t he Bor der St yle field and select D ia log 4. Sw it ch it t o For m View t o preview 5. Save t he form as Ren t a lRa t e s and swit ch it back t o Design View 6. I n t he Proper t ies window , click t he Form at t ab and click Capt ion 7. Type Be t h e sda Ca r Ren t a l - Ren t a l Ra t e s and pr ess Ent er 8. Click Widt h. Type 4 .3 7 5 and press Ent er

9. To com plet e t he dialog box, in t he Form at t ab of t he Propert ies window , change t he follow ing pr opert ies: Au t o Cen t e r : Yes Recor d Se lect or s = N o N a viga t ion But t on s = N o 10. Click t he Det ail bar t o select it . Then, in t he Form at t ab of t he Proper t ies window , click Height . Type 1.875 and press Ent er 11. Preview and save t he form 12. Sw it ch it back t o Design View

M odal D ialog Boxes


A dialog box is charact er ized as m odal if t he user m ust close it befor e cont inuing w it h anot her t ask on t he sam e applicat ion. I n order t o use a dialog box in your applicat ion, you should analyze a scenario and define if t he dialog box is necessary. Use a dialog box if you want t he user t o first t er m inat e w hat ever t ask he or she would be perfor m ing. For exam ple, if a user is perform ing a paym ent of an order processing, it is nat ural t o process and finish t hat paym ent before st ar t ing anot her t ask. A classic ( or norm al) dialog box would need neit her a Recor d Select ors bar nor t he r ecor d navigat ion but t ons. Ther efore, you should decide how t he dialog box w ould be used. I f you w ant a r egular dialog box as t hose available on non - dat abase applicat ions, you should set t he Recor d Select ors, t he Navigat ion But t ons and t he Dividing Lines proper t ies t o No each.

M odeless D ialog Boxes


A dialog box is refer red t o as m odeless if t he user does not have t o close it in or der t o cont inue using t he applicat ion t hat ow ns t he dialog box. The Find dialog box of m ost applicat ions is an exam ple of a m odeless dialog box. I f it is opened, t he user does not have t o close it in order t o use t he applicat ion or t he docum ent in t he background. Since t he m odeless dialog box does not display it s but t on on t he t ask bar , t he user should know t hat t he dialog box is opened. To m ake t he pr esence of a m odeless dialog box obvious t o t he user, it t ypically displays on t op of it s host applicat ion unt il t he user closes it . To cr eat e a m odeless dialog box, or t o convert a form int o a m odeless dialog box, in Design View, set t he Popup pr opert y ( Ot her and All t abs) t o Ye s . This m akes sure t hat t he user can w ork on anot her for m and t he m odeless dialog box or form would r em ain on t op of any ot her form of your dat abase.

Pr actical Lear ning: Cr eating a M odeless D ialog Box


1. The Bet hesda Car Rent al1 dat abase should st ill be opened w it h t he Rent al Rat es dialog box in Design View. To m ake it a m odeless dialog box, in t he Pr opert ies w indow, click t he Ot her t ab. Double click Pop Up t o change it s value from No t o Yes 2. Save and close t he Rent al Rat es dialog box

Lesson Sum m ar y
M CAS: U sing M icr osoft Office Access 20 0 7 Topics
C5 C7 E2 Creat e form s Modify t he design of repor t s and form s Navigat e am ong records

Exer cises Yugo N ational Bank


1. Open t he Yugo Nat ional Bank1 dat abase 2. Configur e t he dat abase t o display in over lapping window s

W atts A loan
1. Open t he Wat t s A Loan1 dat abase 2. Configur e t he dat abase t o display in over lapping window s

You might also like