Вы находитесь на странице: 1из 27

Create Forms

LESSON SKILL MATRIX


Skill Creating Forms Exam Objective Use Form Design Tools. Create a Blank Form. Use the Form Wizard. Apply a Theme. Objective Number 3.1.3 3.1.2 3.1.1 3.2.1

Sorting and Filtering Data within a Form

K KEY TERMS
Blank Form tool B common lters c lter lter by form Form Design button F Form tool Form Wizard Themes

107
Copyright 2012 John Wiley & Sons

108

Lesson 5 Yo You are the owner of the Graphic Art Institute, a small ne-arts gallery dedicated You to presenting challenging and contemporary visual arts and educational proto grams. The current exhibition is successfully under way; you are now calling for s submissions for the next exhibitiona juried art show featuring photographic w work from the local region. The competition is open to all regional artists who us photographic processes in their work. This particular event will be open to use d digital submissions. As each submission is received, you will enter the artist a and image information into an Access database for easy retrieval. In this lesson, you learn how to create forms using a variety of methods; how to apply a Theme to a form; and how to sort and lter data within a form.

SOFTWARE ORIENTATION NTATION


Forms Group Gro Grou rou oup
The Forms group (Figure 5-1) is lo ated on the Create tab in the Ribbon and can be used Form orms loca located b n to create a variety of forms. create a
Figure 5-1 1 Forms group p Create a new new form using the using s g Form Wizard Wizard a Create a new blank form in Design View Create new blank form n Design e an o ign Create simple m Create a simple form re pl l Create a new blank form in Layout View Cr Create blank form in Layout Vie a

Use this gure as a reference throughout this lesson as well as the rest of th book. as the this this hi throughout u o h

CREATING FORMS MS MS
A form is a database object that you can use to enter, edit, or display data from a table or query. Forms can be used to control access to data by limiting which elds or rows of data are displayed to users. For example, certain users might need to see only certain elds in a table. Providing those users with a form that contains just those elds makes it easier for them to use the database. Think of forms as windows through which people see and reach your database in a more visually attractive and efcient way. You can create forms in several different ways, depending on how much control you want over the forms design. Forms that include all elds in a table can be quickly created through a single mouse-click by using the Form tool, or you can control the number of elds youd like to include on the form as well as the layout of the form by using the Form Wizard. You have the most exibility with the amount and placement of elds on the form by using Layout or Design View, with Design View giving you the greatest control over eld placement and properties. Finally, you can quickly apply a chosen theme to the form to modify its color and font scheme using the Themes command. In this section, you practice creating forms using a variety of these skills.

The Bottom Line

Copyright 2012 John Wiley & Sons

Create Forms

109

Creating a Simple Form


You can use the Form tool to create a form with a single mouse-click. When you use this tool, all the elds from the underlying data source are placed on the form. Access creates the form and displays it in Layout View. You can begin using the new form immediately, or you can modify it in Layout View or Design View to better suit your needs. In this exercise, you create a simple form by using the Form tool. To use the Form tool to create a simple form, rst click in the Navigation Pane on the table that contains the data you want to see on the form. On the Create tab, in the Forms group, click Form. To save your form design, click the File tab and click Save. Key a name in the Form Name box and click OK. After you save your form design, you can run the form as often as you want. The design stays the same, but you see current data every time you view the form. If your needs change, you can modify the form design or create a new form that is based on the original.

STEP BY STEP

Create a Simple Form


GET READY. Before you begin these steps, be sure to LAUNCH Microsoft Access. Y. efor Y. Before or steps, be steps, t p Mi 1. OPEN the Graphic Art database from the data les for this lesson. OPEN the Graphic Art database PEN phi atab s abas data at t less

t The Graphic Art le for this lesson is available able on the book companion ion website or in WileyPLUS. LUS.

2. SAVE the database as Graphic Art XXX (where XXX is your initials). SAV SAVE A database as Graphic tabas se Grap Grap ph X eX XXX in 3. In the Navigation Pane, click the Photo Exhibit table. This is the table for which you will 3. click k table. ab abl create a form. 4. On the Create tab, in the Forms group, click the Form button. Acc 4. On he Create tab, in the Forms g ou a h rm rm group, the Form button. Access creates the form and he o m displays Layout Vie displays it in Layout View, as shown in Figure 5-2. Your form may be slightly different. sp ys s y ou ou View, s shown how e 5-2. Your form 2 u

Close Photo Exhibit button

Figure 5-2 Simple form 5. Click the File tab and click Save. The Save As dialog box appears, as shown in Figure 5-3.

Figure 5-3 Save As dialog box

Copyright 2012 John Wiley & Sons

110

Lesson 5 Take Note

You can use the record navigation buttons at the bottom of a form to navigate among the forms records, just as you used them to navigate among records in a table in Lesson 3.
6. Click OK to accept the Photo Exhibit form name suggested by Access. The form name appears in the Navigation Pane. 7. Click the Close button on Photo Exhibit to close the form. 8. LEAVE the database open. PAUSE. LEAVE Access open to use in the next exercise.

Creating a Form in Design View


When you click the Form Design button, a new blank form is created in Design View. Design View gives you a more detailed view of the structure of your form than Layout View. The form is not actually running when it is shown in Design View, so you cannot see the y g g you underlying data while you are making design changes. In this exercise, yo create a new blank form in Design View and manually add elds to it. n manually d l and manu ll add elds You can ne-tune your forms design by working in Design View. To sw un your n kin ne-tune yo working i Design switch to Design View, right-click the form name in the Navigation Pane and then click Desig View. You can also the form name the Navigation h m he avig vg nd then Design View You new use the View button on the Home ta on the Ribbon. You can add ne controlsused to Ve n the Home ta om tab me o edit, informationand by them enter, edit, and nd informationand elds to the form by adding the to the design grid. di the number of properties Plus, the property sheet gives you access to a large number of propertie that you can set to th o access c e customize your form. customize your form. om om z miz

STEP BY STEP

Create Form Create a Form in Design View ea e or nV w View


USE the database that is open from the previous exercise. the database that as h s en from the previous exercise. n r h us u 1. On the Create tab, in the Forms group, click the Form Design button. A new blank form n e b, th Forms group, click the the r p, c p, Design butto e g i created Design View, s shown Figure is created in Design View, as shown in Fig re 5-4. es n e o n igur

Figure 5-4 4 New blank form in Design View w

Copyright 2012 John Wiley & Sons

Create Forms
2. On the Form Design Tools Design contextual tab, in the Tools group, click the Add Existing Fields button. The Field List pane appears, as shown in Figure 5-5. Figure 5-5 Field List pane Field List pane

111

Another Way
You can also display the Field List pane by clicking Alt+F8. Figure 5-6 re Field List pane with Show all ow tables link and expand button 3. Click the Show all tables link, then the expand button to the left of the table name, Click ic ow ll able n ow all tables link, bl button ut le display Photo Exhibit table, as as as shown in Figure 5-6. Th available elds display from the Ph The l y shown s shown in Figure 5-7. Expand button Expand button x d

Table name

Figure 5-7 re Field List pane with available elds Field List pane with available fields

4. In the list of elds, double-click Artist to add it to the form. 5. Double-click Image Title to add it to the form.

Copyright 2012 John Wiley & Sons

112

Lesson 5
6. Double-click Price to add it to the form. Your form should look similar to Figure 5-8. Figure 5-8

Fields inserted in Design View

Fields added to form

Another Way
You can also click the eld name and drag it onto o the form to add a eld. Figure 5-9 9 Form View w

7. Click the File tab and click Save. C ic h il Click the File click Save. l S . 8. In the Save As dialog box, key Photo Label, and click OK. Save As av v box, x Photo h d click OK. cl K 9. On the Design menu, in the Views group, click the lower half of the View button and n Design es n s e Views w click the c h r half a click click Form View to display th form in Form View, as shown in Figure 5-9. i View i y th the m View, e shown Figu o n

3.1.3
How do you use form design tools?

10. Click the Close button on Photo Label to close the form. 11. LEAVE the database open. PAUSE. LEAVE the database open to use in the next exercise.

Copyright 2012 John Wiley & Sons

Create Forms

113

Ref

You learn how to use the commands in the Controls group and a greater variety of form design tools in Lessons 7 and 10.

Creating a Form in Layout View


If other form-building tools do not t your needs, you can use the Blank Form tool to create a form. The Blank Form tool creates a new form in Layout View. This can be a very quick way to build a form, especially if you plan to put only a few elds on your form. Click the Blank Form button to quickly create a new blank form in Layout View; you can make design changes to the form while viewing the underlying data. In this exercise, you use the Blank Form tool to create a form in Layout View. On the Create tab, in the Forms group, click the Blank Form button. Access opens a blank form in Layout View and displays the Field List pane. To add a eld to the form, double-click it or drag it onto the form. In Layout View, you can make design changes to the form while it is displaying data.

STEP BY STEP

Create a Form in Layout View Form


USE the database that is open from the previous exercise. E the database th s that en from exercise. xe xer 1. On 1. On the Create tab, in the Forms group, click the Blank Form bu e Forms o Blan Bl Bl nk button. A new blank form Layout View, with displayed, shown is created in Layout View, with the Field List displayed, as show in Figure 5-10. y w p ay

Figure 5-10 e New blank form in Layout View t

DoubleDouble-click a field to add it to the form fo

2. In the list of elds, double-click Image Title to add it to the form. 3. Double-click Dimensions to add it to the form. 4. Double-click Media to add it to the form. Your form should look similar to Figure 5-11.

Copyright 2012 John Wiley & Sons

114

Lesson 5

Figure 5-11 1 Fields inserted in Layout View w 5. Click the File tab and click Save. Clic Cl ck l Save. a 6. In the Save As dialog box, key Image Info, and click OK. In the e e dialog box, key Image Info, o ox, e m g In click OK. l OK 7. Click the Close button to close the Field List. Click the Close h l to close the Field lo o h 8. Click the Close button on Image In to close the form. Click l C s Close I Image Info the form. h 9. LEAVE the database open. LEAVE e database E a PAUSE. LEAVE the database open to use in the next exercise. next exercise. PAUSE. U the database open h e pe use s x e

3.1.2 2
How do you use the Blank Form tool to create a form?

Take Note

To add more than one eld at a time, press Ctrl and click several elds; the drag them all onto add d one eld ne d n time, m s Ctrl and C l n several ra then, form the form at once. fo m

Using the Form Wizard g th Wizard r


Another method of building a form is to use the Form Wizard tool. The Form Wizard allows method building form e ho di ding m Fo m Wizard Form izar iza ard you to select the elds that will appear on the form, choose the form layo (which determines the e layout t elds will i m ho m, choose the positioning of controls, objects, and data on a form), and also choose a predened style, if f controls, objects, and data on ontrol bjects, n a a trol ls j desired. In this exercise, you use the Form Wizard to create a datasheet fo form. A datasheet form use the Form Wizard wa looks very similar to the table upon which it is based and provides a way to enter data using columns and rows.
STEP BY STEP

Use the Form Wizard


USE the database that is open from the previous exercise. 1. On the Create tab, in the Forms group, click the Form Wizard button, shown in Figure 5-12.

Figure 5-12 Form Wizard button in Forms group

Form Wizard button

Copyright 2012 John Wiley & Sons

Create Forms
2. The Form Wizard displays, as shown in Figure 5-13. Figure 5-13 Form Wizard Click to move selected field

115

Click to move all fields

3. Click the >> button to move all the elds from the Available Fie k the the l from o Fields box to the Selected Fields Fields box. ie ds 4. Click the Next > button to move to the next screen in the Form Wiz . Click Ci t move ov in t the Wizard, shown in Figure 5-14. Figure 5-14 e Form Wizard, next screen

5. Click Datasheet as the layout for the form. Form layouts help d Datasheet as the layout for the form. ta tas eet the yo t or he o determine the controls, objects, and positioning of controls, objects and data on a form. ontrols bjects n bjects c s, 6. Click the Next > button to move to the nal screen in the Form Wizard, as shown in Figure 5-15. Figure 5-15 Form Wizard, nal screen

Copyright 2012 John Wiley & Sons

116

Lesson 5
7. Key Photo Details as the title of the form. 8. Click the Finish button. A datasheet form appears, as shown in Figure 5-16.

Figure 5-16 6 Datasheet form m

Blank Database pane k Database pane D ab a e

9. Click the Close button on Photo Details to close the form. Click l Clo Close Photo Details close the form. h os m

3.1.1
How do you use the Form Wizard to create a form with a predened layout and style?

PAUSE. the database open o use next exercise. PAUSE. LEAVE the database open to use in the next exercise. U h a e pe s e e

Take Note

To include elds from more than one table on your form, do not click Ne or Finish after you include ude more than e or h , do Next select the elds from the rst table on the rst screen of the Form Wizard. Instead, repeat the rst table on the eld lds st ab e of th Wizar t another not d l additional elds a t steps to select another table, and click any additional elds that you want to include on the form and click before continuing. g

Applying a Theme aTheme


The Themes command applies a predened color and font scheme to a form or report. A theme modies a form by controlling the color and fonts of its text. In this exercise, you apply a Theme to a form. To apply a theme, rst switch to Layout View. On the Form Layout Tools Design contextual tab, in the Themes group, click the Themes button to view a gallery of theme styles from which to choose. You can point to each option to see the name of that format and a live preview before its applied to the form.
STEP BY STEP

Apply a Theme
USE the database that is open from the previous exercise. 1. Double-click the Image Info form in the Navigation Pane to open it. 2. On the Home tab, in the Views group, click the lower half of the View button, and click Layout View on the View menu.
Copyright 2012 John Wiley & Sons

Create Forms
3. On the Form Layout Tools Design contextual tab, in the Themes group, click the Themes button, shown in Figure 5-17. Figure 5-17 Themes button Themes button accesses Themes gallery

117

4. A gallery of themes appears, as shown in Figure 5-18. Figure 5-18 Themes gallery

5. Click the Couture theme (fourth row, rst column) to apply it t the form. Notice how 5. the Co h Co theme (fourth m u ur rst column) o s o to the forms text has changed, shown in Figure 5-19. forms text m e changed, shown Figure h n ho Figu Figure 5-19 e Form in Layout View with w Couture theme applied pplied

Theme modified mo labels an record data and

3.2.1
How do you apply a theme to a form? 6. Click the Close button on Image Info to close the form. PAUSE. LEAVE the database open to use in the next exercise.

Copyright 2012 John Wiley & Sons

118

Lesson 5

SORTING AND FILTERING DATA WITHIN A FORM


The Bottom Line

Sorting data in a form can help make it much more effective and easy to use. Sorting helps users review and locate the records they want without having to browse the data. To nd one or more specic records in a form, you can use a lter. A lter limits a view of data to specic records without requiring you to alter the design of the form. You also can use a tool called lter by form to lter on several elds in a form or to nd a specic record.

Sorting Data within a Form


Data can be sorted in the Form View of a form. The order that is chosen when a form is designed becomes that objects default sort order. But when viewing the form, users can sort the records in whatever way is most useful. You can sort the records in a form on one or more elds. In this exercise, you sort data in a form in ascending order.

STEP BY STEP

Sort Data within a Form


USE the database that is open from the previous exercise. database that is s th the prev o h previous v 1. Double-click the Photo Label form in the Navigation Pane to open it in Form View. Double-click -c ic c Photo Label form ot Labe orm t bel e Navigation at at o 2. Right-click the Price eld to display the shortcut menu shown in Fig Right-click ht c Price eld to displ rice display ispla p menu en e Figure 5-20.

Figure 5-20 0 Price eld shortcut menu u

Right-click Right-click g to display o display is is shortcut menu shortcut ho

3. Click Sort Smallest to Largest. The form is sorted by price from sm smallest to largest. The record with the smallest price is displayed rst, as shown in Figure 5-21.

Another Way
You can also sort on a eld by selecting it and clicking the Ascending or Descending button on the Home tab in the Sort & Filter group.

4. Click the Next record button on the record navigator at the bottom of the form. Continue clicking through all the records to see the records in order according to price. 5. On the Home tab, in the Sort & Filter group, click the Remove Sort button. 6. Click the Close button on Photo Label to close the form. PAUSE. LEAVE the database open to use in the next exercise.

Copyright 2012 John Wiley & Sons

Create Forms
Figure 5-21 Form sorted by price

119

Take Note

You cann t sort You cannot sort on a eld that contains attachments. When sorting on a eld with the Yes/No o nnot nn eld tha contains attachments When ld ha o t hat e ts h n ts. o data type, a value of Yes, True, or On is considered Selected; a value of No, False, or data e, value a , a True, T e, considered Selected; o id Sl Off O con dered Cleared. on onsid ed d Off is considered Cleared. Yo You must identify the elds on whic you want to sort. To sort on two or more elds, identify the o identify n y e s n which you want to elds hic o ant ch sort t elds that will act as the innermost and outermost sort elds. Right-click anywhere in the column act s the innermost nd outermost elds e s u ut elds. Right-clic d corresponding to the innermost eld, and click one of the sort comm and lic corresponding o h innermost o o an click e sort commands. The commands vary o based on the type of data that is in the selected eld. Repeat the process for each sort eld, based se e of that is h e selected Repeat ep p ending with the outermost sort eld. The records are rearranged to match the sort order. ending ndi sort o rearranged m e
Ref ef

You already learned how to sort data within a table in Lesson 3. Sorting in a form is very similar. u already lr d w to sort data n Lesson The last-applied sort order is automatically saved with the form. If you want it automatically last-applied ppli p y saved aved d applied the next time you open the form, make sure the Order By On Load property of the form time y open the form, make ime you p he m, ak m , is set to Yes. Remember that you cannot remove a sort order from just a single eld. To remove that h jus sorting from all sort elds, on the Home tab, in the Sort & Filter group, click Remove Sort. elds tab gro

Filtering Data within a Form


Common lters are built into every view that displays data. The lters available depend on the type and values of the eld. When you apply the lter, only records that contain the values that you are interested in are included in the view. The rest are hidden until you remove the lter. In this exercise, you lter form data using common lters. Filters are easy to apply and remove. Filter settings remain in effect until you close the form, even if you switch to another view. If you save the form while the lter is applied, it will be available the next time you open the form. To permanently remove a lter, on the Home tab, in the Sort & Filter group, click the Advanced button and click Clear All Filters.

Copyright 2012 John Wiley & Sons

120

Lesson 5

STEP BY STEP

Filter Data with Common Filters


USE the database that is open from the previous exercise. 1. Double-click the Photo Exhibit form in the Navigation Pane to open it in Form View. 2. Right-click the Media eld to display the shortcut menu and click Text Filters, as shown in Figure 5-22.

Figure 5-22 Media eld text lters

Common Common filters for a text field o m for o

3. Click Contains . . . to display the Custom Filter dialog box, as shown in Figure 5-23. Click c o display e Custom Fi o Filter box, o , show

Figure 5-23 3 Custom Filter dialog box x

4. In the Media contains box key print, and click OK. 4 s box, print OK 5. Click the Next record button on the record navigator at the bottom of the form. Continue clicking to see the ve records that contain the word print in the Media eld. 6. Right-click the Price eld to display the shortcut menu and click Number Filters, as shown in Figure 5-24.

Copyright 2012 John Wiley & Sons

Create Forms
Figure 5-24 Price eld number lters

121

Common filters for a number field for 7. Click Less Than . . . to display the Custom Filter dialog box shown in Figure 5-25. 7. Click Less Cl lic es n to display the Cu dis a i Custom Filter di g i t dialog sho Figure 5-25 e Custom Filter dialog box og

8. In the Price is less than or equal to box, key 500, and click OK. 8. e less t than or eq l to box ox, and click n 9. Click the Next record button on the record navigator at the bottom of the form. 9. xt xt record button t n e record navigator at ec e o bot clicking photos print Continue clicking to see the three photos that use print media and are less than $500. k e h ho ri r 10. On the Home tab, in the Sort & Filter group, click the Advanced Filter Options button 0. On . b, in , Sort r k the h menu shown to display to display the menu shown in Figure 5-26. Figure 5-26 e Advanced Filter Options ptions button menu

11. Click Clear All Filters. PAUSE. LEAVE the database open to use in the next exercise.

Ref

You already learned how to lter data within a table in Lesson 3. Filtering in a form using common lters is very similar.

Copyright 2012 John Wiley & Sons

122

Lesson 5

Using Filter by Form


Although only a single lter can be in effect for any one eld at any one time, you can specify a different lter for each eld that is present in the view. In addition to the ready-to-use lters for each data type, you can also lter a form by completing an action called lter by form. Filter by form is useful when you want to lter several elds in a form or if you are trying to nd a specic record. Access creates a blank form that is similar to the original form, you then complete as many of the elds as you want. When you are done, Access nds the records that contain the specied values. In this exercise, you lter by form. To use lter by form, open the form in Form View and make sure the view is not already ltered by verifying that either the Unltered or the dimmed No Filter icon is present on the record selector bar. On the Home tab, in the Sort & Filter group, click Advanced, and then click Filter by Form. Click the down arrow in a eld to display the available values. Enter the rst set of values on the Look for tab, then click the Or tab and enter the next set of values. Each time you click the Or tab, Access creates another Or tab so y can continue to add you y additional lter values. Click the Toggle Filter button to apply the lter. The lter returns any record that contains all of the values specied on the Look for tab, or all o the values specied of th values specied the of he peci on the rst Or tab, or all of the values specied on the second Or tab, and so on. b, al b, or all f the values h l ie ied n the

STEP BY STEP

Use Filte by Form Filter ilte ilte lter Form r


USE the database that is open from the previous exercise. the e from r m . 1. On the Home tab, in the Sort & Filter group, click the Advanced Filter Options button On e Home m t S t Filter group, the Sort l te k he Advanced Filt e d a and click Filt and click Filter by Form. A form lter appears, as shown in Figure 5 n c lter t Form. fo m form lter e as shown n sh n 5-27.

Figure 5-27 7 Form lter r

Click or tab to add additional filter values

Copyright 2012 John Wiley & Sons

Create Forms

123

2. Place the insertion point in the Dimensions box and click the down arrow on the right to display the list of options shown in Figure 5-28. Figure 5-28 Form lter eld options

Click to see available field values

3. Click 30 3. Click 0 c

40.

4. Click the Or tab at the bottom of the form. 4. k the t e m 5. Place th insertion point in the Dimensions box, click the down arrow, and then click 5. the n th insertion point the Dimensions n h on on click c 12 28. 28. 8 6. On the Home tab, in th Sort & Filter group, click the Toggle Fi 6. Home o in th the rt Filter group, t ilt ou e To Filter button to apply the records lter. The re rds containing either the dimensions 30 40 or 12 28 are displayed, record containing either the dimensions 0 re r co g it r h as shown in Figure 5-29. n Figure gur gure . Figure 5-29 e Form lter results

Indicates the form is filtered

Copyright 2012 John Wiley & Sons

124

Lesson 5
7. Click the Next record button on the record navigator at the bottom of the form to see the second record in the form lter results. 8. On the Home tab, in the Sort & Filter group, click the Toggle Filter button again to remove the lter. 9. On the Home tab, in the Sort & Filter group, click the Advanced button and click Clear All Filters. 10. Click the File tab and click Close Database. STOP LEAVE Access open for use in the projects. .

Take Note

If you want a eld value to operate as a lter that is independent of other eld values, you must enter that value on the Look for tab and each Or tab. In other words, the Look for tab and each Or tab represents an alternate set of lter values.

SKILL SUMMARY SUMMARY R


In This Lesson Lesson ess ear w To You Learned How To: Learned To: Create ae Create Forms Exam Objective ve ve Use Form Design Tools. ool Tools. Create a Blank Form. Use the Form Wizard. ard r Use th the m Wizard. A Apply a Theme. . Apply Objective Number 3.1.3 3.1.2 3.1.1 3.2.1

Sort and Filter Data rt i Sort Filter D Data within a Form m within Form

Knowledge Assessment ssment t


Matching g
Match the term in Column 1 to it description in Column 2. m nC Column its description Column 2. m Column 1 Column 2

1. Form Wizard 2. Form Design button 3. Theme command 4. Blank Form button 5. form 6. lter by form 7. sorting 8. Form tool 9. common lters 10. lter

a. useful when you want to lter on sev several elds in trying nd sp a form or if you are tr ing to nd a specic record o b. creates a simple form with a single mouse-click c. applies a predened combination of colors and fonts that you select for a form or report d. quickly creates a new blank form in Design View e. allows you to select elds for the form, choose the form layout, and also choose a predened style f. limits a view of data to specic records without requiring you to alter the design of the form

g. built into every view that displays data h. database object that you can use to enter, edit, or display data from a table or a query i. j. helps users review and locate records without having to browse the data quickly creates a new blank form in Layout View

Copyright 2012 John Wiley & Sons

Create Forms True/False


Circle T if the statement is true or F if the statement is false.

125

T T T T T T T T T T

F F F F F F F F F F

1. The Forms group is located on the Home tab in the Ribbon. 2. Forms can be used to control access to data, such as which elds or rows of data are displayed. 3. After you save your form design, you can run the form as often as you want. 4. Layout View gives you a more detailed view of the structure of your form than Design View. 5. Using the Blank Form tool is a very quick way to build a form, especially if you plan to put only a few elds on your form. 6. To access the Theme options, rst switch to Form View. 7. You cannot remove a sort order from just a single eld. 8. The lters available depend on the elds data type and values. 9. To lter by form, rst switch to Design View. 10. When using the Form Wizard, you can only include elds from one table. g th Form the e

Competency Assessment ssessment n


Project 5-1: Project 5 1 Project 5-1: Form Wizard oj m Wizard izar
As a travel agent at Erins Travel, you need an easy way to input data about events into the database. s tra el agent Erins Trav l, you need ra rav a in av ave o n d a ay o input data abou y u You decide to use the Form Wizard to create a datasheet form that has a preformatted style. You deci to use o cide cid rm Wizard t create datasheet form that Wiz z c he h p

GET READY. LAUNCH Access f it GET READY. LAUNCH Access if it is not already running. AD AD ce already running. dy d u . The Travel Events le ts s for this lesson is available on the book companion website site or in WileyPLUS. 1. OPEN Travel Events from the data les for this lesson. Tr vel rav s from ro r d data for this lesson. o 2. SAVE the database as Travel Events XXX (where XXX is your initials). 2. e database s Travel Even s XXX t e ravel vent X el e XXX X i 3. On the Create tab, in the Forms group, click the Form Wizard button. 3. Create tab in e Forms group, click ea tab, a om o ou m Wizard b 4. Click the >> button to move all the elds from the Available Fie 4. b o button move o e he elds ld Available Fields box to the Selected a Fields box. 5. Click the Next > button to move to the next page in the Form Wizard. 5. Click C to move in the W 6. Click Datasheet as the layout for the form. Cli Click a the layout he h a u 7. Click the Next > button to move to the nal page in the Form Wizard. Click lc button to move tton tt pag page age W 8. Key Event Details as the title of the form. E n Event th h m. 9. Click the Finish button to create a datasheet form. Finish button to create datasheet inish bu t n h crea e eate atas atash 10. On the Home tab, in the Views group, click the lower half of the View button, and click th Form View. View 11. Click the Close button on Event Details to close the form. 12. CLOSE the database. LEAVE Access open for the next project.

Project 5-2: Used Games Forms


You are the manager at Southridge Video. To expand the store, you have recently started taking used games in trade. You store information about each title in an Access database. You decide to create some forms to help you use the database more efciently.

The Games inventory le for this lesson is available on the book companion website or in WileyPLUS.

GET READY. LAUNCH Access if it is not already running. 1. OPEN Games inventory from the data les for this lesson. 2. SAVE the database as Games inventory XXX (where XXX is your initials). 3. In the Navigation Pane, double-click Games: Table to open the table. 4. On the Create tab, in the Forms group, click the Form button to create a simple form and display it in Layout View.
Copyright 2012 John Wiley & Sons

126

Lesson 5
5. Click the File tab and click Save. 6. In the Save As dialog box, click OK to accept the Games form name suggested by Access. 7. Click the Close button for Games to close the form. 8. On the Create tab, in the Forms group, click the Form Design button to create a new blank form in Design View. 9. On the Form Design Tools Design contextual tab, in the Tools group, click the Add Existing Fields button to display the Field List pane. 10. Click the Show all tables link in the Field List pane. 11. Click the + next to Games to list the available elds. 12. Double-click Title to add it to the form. 13. Double-click Rating to add it to the form. 14. Double-click Platform to add it to the form. 15. Click the File tab and click Save. 16. In the Save As dialog box, key Game Rating, and click OK. 17. Click the Close button to close the Field List. 18. On the Design contextual tab in the Views group, click the lower half of the View c ntextu tab, in the Views group, contextual ab, textu ual e iews h button and click Form View to display form in Form View. d click Form lick ck m in Fo Fo orm 19. Click the Close button for Game Rating to close the form. the Close button for Game Rating h t n ame a th the 20. LEAVE the database open for the next project. LEAVE V database ase as for the e LEAVE Access open for the next project. project. E Access o

Prociency Assessment ssment n


Project Project 5-3: Sort and Filter Games o Sort and Filter Ga e or n ter te Games
A cus omer comes int Southridge Video and asks about game publishers and the availability of a customer ust u into Southri nto nt Southridge Video nd ks about r ri e d ks b bo publishers b s particular game. Sort and lter data in the forms you created to get the information that you need. and lter particula c l lar lt t the forms ou h m u get the informa et e th

USE the database that is open from the previous project. the e at t from r previous vi 1. In the Navigation Pane, double-click the Games form to open it. the h Pane, double-click ne d b c e m o 2. Right-click the Publisher eld to display the shortcut menu. Right-click tt-cl Publisher ld o s d ut ut menu. 3. Click Sort A to Z to sort the form by publisher name in alphabetic o Sort ot sort the form o t he name m order. 4. Navigate to record 3, titled Marvel: Ultimate Alliance. record 3, ec Ultimate Alliance. imat Al mate 5. Right-click the Title eld and click Contains Marvel: Ultimate Allia eld and click Contains ld nd li k C n lick Alliance. 6. Click the Next record button on the record navigator at the bottom of the form to see all the versions of the game with that name. 7. On the Home tab, in the Sort & Filter group, click the Remove Sort button. 8. CLOSE the database. LEAVE Access open for the next project.

Project 5-4: Toy Inventory


Your brother owns Wingtip Toys and recently started keeping a list of the store inventory in an Access database. He wants to add a form to the database and asks for your help. Add a simple form and then show him how to sort and apply lters.

GET READY. LAUNCH Access if it is not already running. The Toy Inventory le for this lesson is available on the book companion website or in WileyPLUS. 1. OPEN Toy inventory from the data les for this lesson. 2. Save the database as Toy inventory XXX (where XXX is your initials). 3. Open Inventory: Table.

Copyright 2012 John Wiley & Sons

Create Forms
4. Use the Form tool to create a simple form. 5. Format it using the Trek theme option (last row, rst column). 6. Save the form as Inventory. 7. Sort the forms In Stock eld from Largest to Smallest. 8. Sort the Description eld from A to Z.

127

9. Run a lter that nds all the records where the Price eld is between $50 and $100. 10. Clear all sorts and lters. 11. Create a lter by form to nd all the records that have two items in stock. 12. Close the form and CLOSE the database. LEAVE Access open for the next project.

Mastery Assessment ssment


Project 5-5: Red Wines 5: 5: Red Wines
The Coho Vineyard has started a monthly wine club. Each month features a red wine hand picked ho Vineyard as st t d month o as started monthly nt t Eac Ea h month ac for its unique label and diverse style. Information about the monthly club selections is stored in an unique s un nd diver e style. d diverse style verse ve er e t the monthly h Access database; you will create forms so that you can retrieve the data in a useful way. Access ces ess e forms for r retr ev triev tr eve

GET GET READY. LAUNCH Access if it is not already running. Access s running. n ng e The Red Wine le for this lesson is available on the book companion website or in WileyPLUS. 1. OPEN the 1. OPEN the Red Wine database from the data les for this lesson OP Wi e atab s fr m Wine data ase from a les for this lesson. s o th 2. Save the database as Red Wine XXX (where XXX is your initia 2. Save the v h e Re W e Red Wine XXX X e XX s your initials). XXX o 3. Create a simple form that contains all the elds in the Club Se 3. Create simple at m contains o elds the l h Selections table and name it Club Wines. b Wines. in n 4. Use the Form Design button to create a form named Wine Details that looks like the 4. e rm m n button o u for orm r d Wine Det shown n Figure 5 one shown in Figure 5-30 when displayed in Form View. w ur 5-30 when d r h displayed y View. w Figure 5-30 e Wine Details form s

5. CLOSE the database. LEAVE Access open for the next project.

Copyright 2012 John Wiley & Sons

128

Lesson 5

Project 5-6: Personal Contacts


Your address book is becoming outdated, and you decide to transfer all the current information about friends and family to an Access database. Input the data and then create forms to manage it efciently.

GET READY. LAUNCH Access if it is not already running. The Personal Contacts le for this lesson is available on the book companion website or in WileyPLUS. 1. OPEN Personal Contacts from the data les for this lesson. 2. SAVE the database as Personal Contacts XXX (where XXX is your initials). 3. Input as much contact information as you have about at least ve friends or family members. 4. Create a simple form named Friends/Family using the Form tool. Apply the Black Tie theme. 5. Create a form named Birthday Contacts using the Form Wizard. Include the following elds: First Name, Last Name, E-mail Address, Home Phone, Mobile Phone, and Birthday. Use the Columnar layout. Keep all other default settings. 6. CLOSE the database. STOP CLOSE Access. . .

INTERNET READY NET READY A


Microsoft has numerous online resources availas numerous online resources availr us nli ce e il able to provide solutions, services, and support for whatever whatever s, and support , o hat r a business needs you may have. If you are a small or midsized small midsized ave. you m ie business, a helpful site is the Microsoft Business for Small Microsoft Business r u ne e ll ll & Midsize Companies. Here, you can nd advice, products, ere, u can advice ad ce, e
Figure 5-31 1 Microsoft Business for Small & Midsize Companies s

tools, tools, and information tailored to small and midsized o tailored a businesses. Search the Microsoft site for Small & Midsize businesses. usinesses. sses h the Microsoft he o Companies, shown in Figure 5-31. Explore the resources Companies, o p nie Figure gure e E offered on the site. In the Latest Editions section, choose a offered ffe d . n Lat Latest Editi topic pi pi h you would like kn o l i topic about which you would like to know more, and read an article tic i interests es e s article that interests you.

Copyright 2012 John Wiley & Sons

Circling Back 1

129

Circling Back 1
You are a real estate agent and have recently opened your own ofceWoodgrove Real Estatewith several other licensed agents. Because you are the one who is most knowledgeable about computers, you will be responsible for keeping track of the listings and other relevant information. You will use Access to begin developing the database that will be used by everyone in the ofce.

Project 1: Create a Database and Tables


After sketching out a plan on paper, you are ready to begin creating the database and tables.
GET READY. LAUNCH Access if it is not already running. 1. In the Available Templates section, click the blank database ico if its not already icon selected. 2. In the File Name box, key Woodgrove XXX (where XXX is your initials). Name box, key Woodgrove ame box, ey Woodgrov m ox, X you 3. Click the folder icon and browse to the loca ion where you wa to store the le. the folder he o h location ocat want 4. Click the Create button to create a new blank database. Click li li te button to create e utton e kd database. 5. Click Click to Add and click Text on the shortcut menu. Click li o Add Ad click Text ic ut menu. t 6. Key 6. Key Address as the column name and press Enter. column u n Enter. e 7. 7. Add new Text columns named Bedrooms, Bathrooms, Square Feet, and Price. nam named Bathrooms, om om 8. Click the 8. Click the File tab and click Save. l b and click Save. d i ve 9 9. In the Save As dialog box, key Listings as the table name and click OK. th the Save dialog box, key lo ox ke th the table name e a 10. 10. On the Create tab, in the Templates group, click the Application Parts button, and click he Create t Templates group, click the e p, p Applicatio p Contacts to Contacts to create a new table. Click OK, if necessary to close and save the Listings ac ac new table. ew b e OK, necessary, K ry, r table, then click Cancel in the Create Relationship dialog box that appears. then c he click Cancel in the C ce t Create Relationship dialog el e t l t 11. 11. Open the Contacts table. e Contacts table. o ts ab e s 12. 12. Right-click the Company eld header and click Delete Field on the shortcut menu. Click 2 k the Company eld header an t Co y ea e and Delete e OK if you receive a dialog box warning you about the deletion. K receive dialog box warning ec v og o arnin ng the deletion e 13. 13. Delete the Job Title, Business Phone, Fax Number, Address, C 3 obTitle, Business Phone, ob b s e ne e Number, Address, City, State/Province, ZIP/ r Country/Region, and Postal Code, Country/Region, Web Page, Notes, and Attachme columns. (If you get a e o an Attachment message message asking if yo want to delete all indexes for the ZIP column, click Yes.) g if you wan o want es es for co 14. Save the table as Agents. Save ave v as Agents. g nts 15. Delete all the objects in your database except the Agents and Listings tables. Delete all et a t objects in ects except xc xcept LEAVE the database open to use the PAUSE. LEAVE the database open to use in the next project. A E he atabas pen s

Project 2: Modify Tables and Fields Modif


Now that you have created the tables for your database, you need to modify them to suit your needs.
USE the database that is open from the previous project. The Agents table should be displayed. 1. On the Home tab, in the Views group, click Design View. 2. On the Table Tools Design contextual tab, in the Show/Hide group, click Property Sheet. 3. In the Property Sheets Description property box, key Agent contact information. 4. Click Close to close the property sheet.

Copyright 2012 John Wiley & Sons

130

Circling Back 1
5. In the upper portion of the table design grid, click the E-mail Address eld. In the eld properties on the bottom, click in the Required property box and set it to Yes. 6. Save the table and switch back to Datasheet View. 7. Open the Listings table. Place the insertion point in the Price column. 8. On the Table Tools Fields contextual tab, in the Formatting group, click the down arrow in the Data Type box and click Number. 9. In the Format box, click the down arrow and choose Currency. 10. Change the data type/format on the Bedrooms, Bathrooms, and Square Feet elds to Number/General Number. 11. Click the Click to Add column. Choose Attachment as the data type to create an attachment column. 12. Save the table. PAUSE. LEAVE the database open for the next project.

Project 3: Create Forms and Enter Data


nter ta nto yo atabase atabas Now it is time to enter data into your database. First you create a form to make this task easier. enter data into your database. First
USE the database that is open from the previous project. The Listings t database abas abas b project. roje oj table should be displayed. . th tab, b Forms rms More Forms butto re r F 1. On the Create tab, in the Forms group, click the More Forms button. 2. Click Datasheet to create a datasheet form. Click lick datasheet a 3. Click the File tab and click Save. Click the File ic h ile and click Save. n lick Save. ck ave 4. In the Save As dialog box, key Listings as the form name and click OK. In Sa e Save g box, key Listings x s n form name om m 5. Use the form to enter data into the Listings table, as show in Figu 1. Use e form r data in o the a into he table, bl b , shown Figure own ow w

Figure 1 Listings data

Copyright 2012 John Wiley & Sons

Circling Back 1
6. Display the Agents table. 7. On the Create tab, in the Forms group, click the Form button. 8. Save the form as Agents. 9. Switch to Form View and use the form to enter the data shown in Figure 2.

131

Figure 2 Agents data, record 1

10. 10. Click the Next record button on the record navigator. k the e d button to o d na navigator. o 11. 11. Enter the data shown in Figure 3 as the second record. the data in Figure second record. c od

Figure 3 ure Agents data, record 2 cord

Copyright 2012 John Wiley & Sons

132

Circling Back 1
12. Enter the data shown in Figure 4 as the third record. Figure 4 Agents data, record 3

13. Close the Agents form and the Listings form. Close o the PAUSE. LEAVE PAUSE. LEAVE the database open for the next project. S EA E database o en for the next project. ab abas open or h ct

Project Add Attachments and Create Lookup Field Project 4: Add Attachments and Create a Lookup Field o d ts d s kup
You have begun to use the database and realize it would be helpful for the Listings table to u have n u use database and atab n it would helpful e include the listing agent. Create a lookup eld with this information and attach photos for some include l d g agen Create look a ent. eat lookup eld with this information te k t th m tio a of the houses. the he h
USE the database that is open from the previous project. E the that is open from ha rom ro r previous revio o 1. In the Listings table, double-c ick the Attachment eld for the four record (677 West the table double-click ble le, -cli Atta ttachment d for fourth Avenue). Ave Av Avenue). 2. In the Attachments dialog box, click Add. the h dia g box, click dialog o ox The 677_West_ Avenue le is available for download on the companion website. 3. Navigate to the data les for this lesson, select 677_West_Avenue, and click Open. Navigate ga a les for this e o th 677_ 677_West_Avenue 4. In the Attachments dialog box, click OK. Attachments ta hm a oto ot named 20 _Sundown L e t 2002 Sundow n o 5. Attach the photo named 2002_Sundown_Lane to the sixth record. photo n me 2002_Sundown_Lane 6. Close the Listings form. The 2002_ Sundown_Lane le is available for download on the companion website. 7 Dis la 7. Display the Listings table and place the insertion point in the cell under the Click to Listi s a d lace i se tio oi t i Add column. 8. On the Table Tools Fields contextual tab in the Add & Delete group, click the More Fields button. Click the Lookup & Relationship command. 9. Click Next > twice. 10. Click Last Name and then click the > button to move it to the Selected Fields box. 11. Click Next > three times. 12. Key Listing Agent as the title for your lookup column. 13. Click Finish. 14. Save the Listings table. PAUSE. LEAVE the database open for the next project.

Copyright 2012 John Wiley & Sons

Circling Back 1

133

Project 5: Modify a Form


Now that you have a lookup eld, you want to add it to your form and use it to enter additional information.
USE the database that is open from the previous project. 1. Display the Listings form and switch to Design View. 2. Click the Field1 eld on the design grid and press Delete. 3. On the Form Design Tools contextual tab, in the Tools group, click Add Existing Fields. 4. In the Fields available for this view box, click Listing Agent and drag it to the form below the Price eld. 5. Close the Field List and switch to Datasheet View. 6. In the Listing Agent column click the down arrow and select the last name for each record, as shown in Figure 5.

Figure 5 ure Listing agents

7. Close the form. e the e STOP CLOSE the database. . STOP CLOSE the database. S se.

Copyright 2012 John Wiley & Sons

Вам также может понравиться