7
HANDS-ON EXERCIS 1 Form Basics I HOE1Training It is your first day on the job at Santiago Coffee Shop. After talking with Alex about his data entry needs, you decide to create several sample forms with different formats. You will show each form to Alex to get his feedback and see if he has a preference. Remember to select the correct record source prior to creating each new form. Skills covered: Use the Form Tool and Adjust Column Widths in a Form Create a Split Form Create a Multiple Items Form « Create a Datasheet Form and Delete a Field from a Form • Add a Field to a Form Change the Sorting in a Form and Remove Sorting in a Form STEP1 USE THE FORM TOOL AND ADJUST COLUMN WIDTHS IN A FORM Use the Form tool to create an Access form to help Alex manage his customers. This form will enable Tonya to add, edit, and delete records more efficiently than working with tables. Refer to Figure 4.7 as you complete Step 1. f Customer Information form I created with the Form tool Stacked layout V Orders subform automatically added by Access FIGURE 4.7 Form Created with the Form Tool > > Customer information "*"] Custon Customer ID Customer Name Contact E-mail Address Addressl Address2 Citv State Zip Code Phone Fax Service Start Date Credit Rating Sales Rep ID Order 10 * orxx > ooo + ooo * (Nev ier Information [C0006 Lugo Computer Sales Derek Anderson [email protected] | 6000 Tigertail Avenue 1 Warrington PA 18975- (555) 446-8900 | (555) 446-8901 J 2/10/2012 £_ IB son v- Order Date - Payment Type - Comments 8 1/10/2012 Credit Card .3 1/23/2012 Credit Card .8 1/25/2012 Check Will pick up order »> fR«o«i M < 4 of 4 > W> j^NoF;- Search Record. H < 6 of 14 » H > Starch a. Open a04hl coffee. Click the File tab, click Save Database As, and then type a04hlcoffee_ LastnameFirstname. Click Save. , TROUBLESHOOTING: Throughout the remainder of this chapter and textbook, click Enable I Content whenever you are working with student files. X^ ..-^n.Tj^-,.-. —' , TROUBLESHOOTING: If you make any major mistakes in this exercise, you can close the file, I repeat step a above, and then start over. b. Click the Customers table in the Navigation Pane. Click the Create tab, and then click Form in the Forms group. Access creates a new form with two record sources—Customers (with stacked layout, on top) and Orders (with tabular layout, below). Access found a one-to-many relationship between the Customers and Orders tables. The form opens in Layout view. CHAPTER 4 Creating and Using Professional Forms and Reports

HANDS-ON EXERCIS€¦ · The Customer Information title, a label control, is an example of an unbound control; an unbound control does not have a connection to an underlying table

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: HANDS-ON EXERCIS€¦ · The Customer Information title, a label control, is an example of an unbound control; an unbound control does not have a connection to an underlying table

HANDS-ON EXERCIS

1 Form Basics

I HOE1 Training

It is your first day on the job at Santiago Coffee Shop. After talking with Alex about his data entry needs, you decide to createseveral sample forms with different formats. You will show each form to Alex to get his feedback and see if he has a preference.Remember to select the correct record source prior to creating each new form.

Skills covered: Use the Form Tool and Adjust Column Widths in a Form • Create a Split Form • Create a Multiple Items Form «Create a Datasheet Form and Delete a Field from a Form • Add a Field to a Form • Change the Sorting in a Form and RemoveSorting in a Form

STEP1 USE THE FORM TOOL AND ADJUST COLUMN WIDTHS IN A FORMUse the Form tool to create an Access form to help Alex manage his customers. This form will enableTonya to add, edit, and delete records more efficiently than working with tables. Refer to Figure 4.7as you complete Step 1.

f Customer Information formI created with the Form tool

Stacked layout V

Orders subform automaticallyadded by Access

FIGURE 4.7 Form Createdwith the Form Tool >

>

Customer information

"*"] Custon

Customer ID

Customer Name

Contact

E-mail Address

Addressl

Address2

Citv

State

Zip Code

Phone

Fax

Service Start Date

Credit Rating

Sales Rep ID

Order 10

* orxx

> ooo+ ooo

* (Nev

ier Information

[C0006

Lugo Computer Sales

• Derek Anderson

[email protected]

| 6000 Tigertail Avenue

1

Warrington

PA

18975-

(555) 446-8900

| (555) 446-8901

J

2/10/2012

£_ IBson

v-• Order Date - Payment Type - Comments

8 1/10/2012 Credit Card

.3 1/23/2012 Credit Card

.8 1/25/2012 Check Will pick up order

»>

fR«o«i M < 4 of 4 > W > j ^ N o F ; - Search

Record. H < 6 of 14 » H > Starch

a. Open a04hl coffee. Click the File tab, click Save Database As, and then type a04hlcoffee_LastnameFirstname. Click Save.

,TROUBLESHOOTING: Throughout the remainder of this chapter and textbook, click Enable

I Content whenever you are working with student files.X^ ..- n.Tj -,.-. —'

,

TROUBLESHOOTING: If you make any major mistakes in this exercise, you can close the file,I repeat step a above, and then start over.

b. Click the Customers table in the Navigation Pane. Click the Create tab, and then clickForm in the Forms group.

Access creates a new form with two record sources—Customers (with stacked layout, ontop) and Orders (with tabular layout, below). Access found a one-to-many relationshipbetween the Customers and Orders tables. The form opens in Layout view.

CHAPTER 4 • Creating and Using Professional Forms and Reports

Page 2: HANDS-ON EXERCIS€¦ · The Customer Information title, a label control, is an example of an unbound control; an unbound control does not have a connection to an underlying table

C. Click the top text box containing C0001. The text box is outlined with an orange border.Move the mouse to the right edge of the orange border until the mouse pointer changes to adouble-headed arrow. Drag the right edge to the left until the text box is approximately 50%of its original size.

All the text boxes and the sub form at the bottom adjust in size when you adjust the top textbox. This is a characteristic of Layout view—enabling you to easily modify all controls at once.

[ TROUBLESHOOTING: You may need to maximize the Access window, or close the Navigation1 Pane, if the right edge of the text box is not visible.

d. Click the Arrange tab, and then click Select Layout in the Rows & Columns group.

All the controls are now selected.

C TROUBLESHOOTING: Click any control in the top part of the form before you click Select layout.

e. On the Arrange tab, click Control Padding in the Position group. Select Narrow from thelist of choices.

The space between the controls is reduced.

f . Click Save in the Quick Access Toolbar, and then type Customer Information as the formname in the Save As dialog box. Click OK.

g. Click the Home tab, and then click View in the Views group to switch to Form view, theview that most users will see. Advance to the sixth customer, Lugo Computer Sales, using theNavigation bar at the bottom of the form.

| TROUBLESHOOTING: Two Navigation bars exist, one for the main form and one for the{ subform. Make sure you use the bottom one that shows 14 records.

h. Double-click the Customers table in the Navigation Pane.

Two tabs now appear in the main window. You will compare the table data and the formdata while you make changes to both.

i. Verify the sixth record of the Customers table is Lugo Computer Sales, which correspondsto the sixth record in the Customer Information form. Click the tabs to switch between thetable and the form.

j. Click the Customer Information tab, and then replace Derek Anderson, the contact forLugo Computer Sales, with your name. Advance to the next record to save the changes.Click the Customers tab to see that the contact name changed in the table as well.

The contact field and the other fields on the Customer Information form are bound controls.Changing the data in the form automatically changes the data in the underlying table.

-TROUBLESHOOTING: If the change to Derek Anderson does not appear in the Customers table,check the Customer Information form to see if the pencil appears in the left margin. If it does, savethe record by advancing to the next customer, and then recheck to see if the name has changed.

k. Replace your name with Derek Anderson. Save the record by clicking on the record belowLugo Computer Sales. Click the Customer Information tab, and then find the sixth record.You should see the change you just made — Derek is back!

I. Switch to Layout view. Click the Customers title at the top of the form to select it, and thenclick again and change the title to Customer Information.

The Customer Information title, a label control, is an example of an unbound control; anunbound control does not have a connection to an underlying table.

Hands-On Exercises • Access 2O1O

Page 3: HANDS-ON EXERCIS€¦ · The Customer Information title, a label control, is an example of an unbound control; an unbound control does not have a connection to an underlying table

m. Click Save in the Quick Access Toolbar to save the changes to the form's title. Close theform and the table.

| TROUBLESHOOTING: If you make a mistake that you cannot easily recover from, considerI deleting the form and starting over. The Form tool makes it easy to start over again.

STEP 2 CREATE A SPLIT FORMUse the Split Form tool to create a different form to show to Tonya. She may prefer to use a splitform to add, edit, and delete records rather than the Customer Information form that you created inthe previous step. Refer to Figure 4.8 as you complete Step 2.

s"

(Change the e-mail address

f Splitter bar

[ Changes in the top sectionI are reflected in the bottom

FIGURE 4.8 Form Createdwith the Split Form Tool >•

H\s

] Customers - Split ViewT

Customer ID C0006

Customer Name Lugo Computer Sales

Contact Derek Anderson

E-mail Address [email protected]

Addressl 6000 Tigertail Avenue

Address2

City i Warrington

1 , , , ~ .

< X-m-r j

C0001 Abel & Young Jeff JonesC0002 Department of CIS Eleanor MilgromC0003 Advantage Sales Neil GoodmanC0004 Kinzer&Sons Nicholas Colon

^COOOS Milgrom Associates Ashley GeogheganC0006 Lugo Computer Sales Derek AndersonC0007 Bethune Appliance Sales Michael WareC0008 Baker Auto Supply Robert SlaneC0009 Howard Animal Hospital LuisCouto

1 Record: M 4 6 of 14 > H > Search lil—

~| State FPA

j Zip Code [ 18976-

| Phone | (215) 446-8900

| Fax (215)446-8901

j Service Start Date 2/10/2012

j Credit Rating |c

~] Sales Rep ID SQ01

E-mail Address - Addressl

5000 Jefferson Lane1238 Walsh Drive

[email protected] 4215 South 81 Street9020 N.W. 75 Street

[email protected] 7500 Center [email protected] 6000 Tigertail [email protected] 276 Brickell [email protected] 4508 N.W. 7 [email protected] 455 Bargello Avenue

__J!L

X

>

- Add re "•

Suite 2Suite 2 s

Suite 3

Suite 1.

2>

a. Verify the Customers table is selected in the Navigation Pane. Click the Create tab, clickMore Forms in the Forms group, and then select Split Form from the list.

Access creates a new form with a split view, one view in stacked layout and one view intabular layout.

b. Switch to Form view. In the bottom portion of the split form, click Lugo Computer Sales, thesixth record. Notice the top portion now displays the information for Lugo Computer Sales.

C. Change [email protected] to [email protected] in the top portion ofthe form.

The bottom portion reflects your change when you move to another field or advance toanother record.

d. Click another record, and then click back on Lugo Computer Sales.

The pencil disappears from the record selector box and the changes are saved to the table.

e. Click anywhere on the Coulter Office Supplies customer in the bottom portion of the form(record 14).

The top portion shows all the information for this customer.

CHAPTER 4 • Creating and Using Professional Forms and Reports

Page 4: HANDS-ON EXERCIS€¦ · The Customer Information title, a label control, is an example of an unbound control; an unbound control does not have a connection to an underlying table

r f. Modify the Contact, E-mail Address, and Address 1 information in the top portion of theform, by typing xyz at the end of each cell. Save your changes by clicking anywhere in thebottom portion of the window.

Notice the xyz characters appear in the bottom portion of the form.

g. Remove the xyz's from the Coulter Office Supplies record in the top section.

h. Switch to Layout view. Click the Customers title at the top of the form to select it, and thenclick Customers again and change the title to Customers - Split View.

i. Click Save on the Quick Access Toolbar, and then type Customers - Split View in the FormName box. Click OK.

j. Move your mouse over the splitter bar, the border between the top and bottom portions ofthe window. When the pointer shape changes to a double-headed arrow, drag the splitterbar up until it almost touches the Sales Rep ID field.

k. Close the form and save the changes when prompted.

STEP 3 CREATE A MULTIPLE ITEMS FORMYou decide to use the Multiple Items tool to create a form for Alex to manage his products. Becauseof its tabular format, it will enable Alex and Tonya to view multiple records at one time. Refer toFigure 4.9 as you complete Step 3.

r~

Technic theme applied

/"

( Title modified in Layout view

[ Tabular format

FIGURE 4.9 Form Createdwith the Multiple Items FormTool>

1—

£fj Products

"1 Products - Mult

- roduct Name

T

*-

iple Items

POOOl Coffee - Colomb an Supreme 24/Case, Pre-Ground 1.75 Oz Bags

! P0002 ; i Coffee - Hazelnut j 1 24/Case, Pre-Ground 1.75 Oz Bags

i P0003J! Coffee -Mild Blend ! i 24/Case, Pre-Ground 1.75 Oz Bags

S16.00

^]i $23.00

$20.00

j P0004JJ Coffee -Assorted Flavors 18/Case. Pre-Ground 1.75 Oi Bags $23.00

i POOOSii Coffee -Decaf j| 24/Case, Pre-Ground 1.75 Oz Bags

D0006 Tea Bags - Regular li 75/Box, Individual Tea Bags

j P0007 Tea Bags - Decaf i! 75/Box, Individual Tea Bags

P0008 Creamers - Assorted Flavors 400/Case, 8 50-count Boxes

P0009 Creamers - Liquid Jj200/Case, individual Creamers

| P0010 ; Sugar Packets

| POOlljj Ceramic Mug

| P0012; Sugar Substitute

[ P0013JI Coffee Filters

P0014 Napkins

P0015 Stirrers- Plastic

P0016 Stirrers -Wood

P0017 Spoons

P0018 Popcorn -Plain

cord: M 1 of 25 > W > t, tie Fi

| 2000/Case

SDCoripjny Logo

: 500/Case, 1-Serving Bags

J[~~$20.0C

_J $5.00

jtri™)"$20.00

J $15.00 i

$18.00

J[Zj£Sr$19.00

!]500/Case, Fits 10-12 Cup Coffee Make] $3.00

jJ3000/Case, White

|| 1000/Box

|| 1000/Box

i jSOO/Box, White Plastic

ii 36/Case, 3.75 Oz Microwave Bags

s Search <

$20.00

~]| $1.50

| $1.25

|j $15.00

Z]LZ^°"

X

50.00%

100.00%

50.00%;

! 50.00%]

50.00%!

i 75.00%

75.00%!

100.00%!

100.00%!

100.00%

100.00%:

50.00% I -

50.00%!

100.00%;

[ 75.00%

[ 100.00% 1

ioo.oo%i

100.00% L

>

r

a. Click the Products table in the Navigation Pane. Click the Create tab, click More Forms inthe Forms group, and then select Multiple Items from the list.

Access creates a new multiple items form based on the Products table. The form resemblesthe datasheet of a table—both have a tabular layout.

b. Click cell POOOl. Move the mouse over the bottom edge of cell POOOl until the pointershape changes to a two-headed arrow. Drag the bottom edge up to reduce the height of therows by 50%.

Changing the height of one row affects the height of all the rows.

C. Click the Products title at the top of the form to select it, and then click again on Productsand change the title to Products - Multiple Items.

Hands-On Exercises • Access 2O1O

Page 5: HANDS-ON EXERCIS€¦ · The Customer Information title, a label control, is an example of an unbound control; an unbound control does not have a connection to an underlying table

STEP 4

d. Click the Themes arrow in the Themes group on the Design tab. Right-click the TechnicTheme (near the bottom of the gallery), and then choose Apply Theme to This ObjectOnly.

Hover over a theme and its name will display as a ScreenTip. The Technic theme is appliedto the Products - Multiple Items form.

e. Close and save the form as Products - Multiple Items.

CREATE A DATASHEET FORM AND DELETE A FIELD FROM A FORMYou decide to use the Datasheet tool to create another form for Alex to manage his products. TheDatasheet form is in tabular format and is similar to the Multiple Items form, but requires little or nomaintenance, which Alex may like. Refer to Figure 4.10 as you complete Step 4.

Datasheet form basedon the Products table

-

Field name modified

Datasheet form lookssimilar to Datasheet view

FIGURE 4.10 DatasheetForm >•

_jj Products - Datasheet:

Product ID

P0001

P0002

P0003

P0004

P0005

P0006

-'CCC7

:pooo8P0009

P0010

;POOIIP0012

P0013

P0014

POO 15

P0016

P0017

P001S

P0019

P0020

P0021

P0022

;P0023

P0024

P0025

* (New)

Product Name

Coffee - Colombian SupremeCoffee- HazelnutCoffee - Mild BlendCoffee - Assorted FlavorsCoffee - DecafTea Bags - RegularTea Bags - DecafCreamers - Assorted FlavorsCreamers- LiquidSugar PacketsCeramic Mug

Sugar SubstituteCoffee FiltersNapkinsStirrers - PlasticStirrers-WoodSpoonsPopcorn - PlainPopcorn - ButteredSoup - ChickenSoup - Variety PakStyrofoam Cups - 10 ounce

Styrofoam Cups - 12 ounceMilk- 1 quartMilk- Ipint

Description » R

24/Case, Pre-Ground 1.7S Oz Bags24/Case, Pre-Ground 1.75 Oz Bags24/Case, Pre-Ground 1.75 Oz Bags18/Case. Pre-Ground 1.75 Oz Bags24/Case, Pre-Ground 1.75 Oz Bags75/Box, Individual Tea Bags75/Box, Individual Tea Bags400/Case, 8 50-count Boxes200/Case, Individual Creamers2000/CaseSD Company Logo500/Case, 1- Serving Bags500/Case, Fits 10-12 Cup Coffee Maker3000/Case, White1000/Box1000/Box500/Box, White Plastic36/Case, 3.75 Oz Microwave Bags36/Case, 3.75 Oz Microwave Bags50 Envelopes50 Envelopes1000/Case1000/CaseDelivered DailyDelivered Daily

sfrig? *• Brand

Discount

13 Premiumn House

d HouseD DiscountD House

HouseD Discount13 PremiumD House

CH Housen DiscountD House

d Housed DiscountD Discountd House

EJ HouseCi House[U PremiumE3 Premium

Housed HouseEl House

El HouseCI House

X

- Year Introduce

2008

2008

2008

2008

2008

2008

2008

2008

2008

2008

2008

2008

2008

2008

2008

2008

2008

2008

2008

2008

2008

2008

2008

2008

2008

2010

a. Verify the Products table is selected in the Navigation Pane. Click the Create tab, clickMore Forms in the Forms group, and then select Datasheet.

Access creates a new datasheet form based on the Products table. The Tabular form lookssimilar to the Products table and could be easily mistaken for a table.

b. Click Save in the Quick Access Toolbar, and then type Products - Datasheet in the FormName box. Click OK.

C. Widen the Navigation Pane so all object names are visible. Right-click the Products -Datasheet form in the Navigation Pane, and then choose Layout View from the list of options.

TROUBLESHOOTING: The View arrow does not contain the Layout view options.

d. Click anywhere in an empty area to deselect the controls.

e. Click the Cost box, the control on the right, to select it (you will see the orange border), andthen press Delete. Click the blank space, and then press Delete to remove the blank space.Repeat the process to delete MarkupPercent.

You removed fields from the Products form and the other fields adjust to maintain an evendistribution (after you remove the blank space).

CHAPTER 4 • Creating and Using Professional Forms and Reports

Page 6: HANDS-ON EXERCIS€¦ · The Customer Information title, a label control, is an example of an unbound control; an unbound control does not have a connection to an underlying table

f. Click the Refrigeration Needed label to select it. Change the label to the abbreviationRefrig?. Save the form, and then switch to Datasheet view.

g. Double-click the Products table in the Navigation Pane to open it.

The Products - Datasheet form and the Products table now appear different because theCost and MarkupPercent fields were deleted from the form.

h. Close the Products Datasheet form and the Products table.

rSTEPS ADD A FIELD TO A FORM

The form tools made it easy to create forms for Alex's company. But Alex decided he needs aWebsite field, so you need to modify the form. Refer to Figure 4.11 as you complete Step 5.

rCustomer information

form in Layout view

Website field addedto customers table

| Orange line indicates theposition of the new field

FIGURE 4.11 Add a NewField to a Form >

|ab[ Aa

Views Themes ;

All Access Objects • «

Tables S

S3 Order Details

Si Orders

SI Products

tH Sales Reps

Queries V

33 Customer Information

1=1 Customers - Split View

33 Products - Datasheet

33 Products - Multiple Kerns

!

-

T ES -Customer ID

Customer Name

Contact

field List » X

Controls I jj> showa«tabtes

s available for this viewi ustomerlD

ner Information \eontact

CCCCi

Abel & Yojrg

I Jeff Jones

E-mail Address

:| Website

Addressl

Address2

City

State

Zip Code

Phone

Fax

i Service Start Date

i Credit Rating

: SalesRepiD

Order ID

•sH oaMB oaME oa

tord- M 1 ot 14 >

|www.microsoft.com

5000 Jefferson Lane

Suite 2000

Doylestown

|PA

18901-

AddresslAddress!CrtyStateZipCodePhoneFaxServiceStartDateCredit RatingSalesRepiD

i

(555) 375-6442

| (555) 375-6443

1/3/2012

B

S001

- Order Date - Payment Type - Comments

X)l 1/3/2012 Cash Will pick up order

06 1/6/2012 Check

318 1/21/2012 Credit Card

H I | Search

a. Right-click the Customers table in the Navigation Pane, and then click Design View.

You will add the Website field to the Customers table.

b. Click the Addressl field, and then click Insert Rows in the Tools group.

A new row is inserted above the Addressl field.

C. Type Website in the blank Field Name box, and then choose Hyperlink as the Data Type.

d. Close and save the Customers table.

6. Right-click the Customer Information form in the Navigation Pane, and then clickLayout View.

You will add the Website field to the Customer Information form.

f. Click Add Existing Fields in the Tools group to display the Field List pane (if necessary).

g. Drag the Website field from the Field List pane to the form, below the E-mail Address field,until an orange line displays between E-mail Address and Addressl and release the mouse.

Access shows an orange line to help you place the field in the correct location.

Hands-On Exercises • Access 2O1O

Page 7: HANDS-ON EXERCIS€¦ · The Customer Information title, a label control, is an example of an unbound control; an unbound control does not have a connection to an underlying table

STEP 6

h. Switch to Form view. Press Tab until you reach the Website field, and then type www.microsoft.com into the field.

j. Press Tab until the focus reaches the Orders sub form to verify the tab order is correct.

j. Close and save the Customer Information form.

CHANGE THE SORTING IN A FORM AND REMOVE SORTING IN A FORMAlex tested the Customer Information form and likes the way it is working. He asks you to change thesorting to make it easier to find customers with a similar Customer Name. Refer to Figure 4.12 as youcomplete Step 6.

f Click Ascending to sortby customer name

fSelect customer name

Advance to the next recordto verify sort order

FIGURE 4.12 DatasheetForm >

W :?t AsEentfmgi 'ff SelectionIJ zTn"~11 Descendmg »3 Advanced-

Sort / Toggle Fi!t(

Sort & filter

J Customer Information

Forms

3! Customers - Split View

Products. Datasheet

Products - Multiple Re

5000 Jefferson une

Suite 2000

Service Start 0;

Credit Rating

Sales Rep ID

Payment Type - Comments

1/3/2012 Cash Will pick up orde

1/6/2012 Check

1/21/2012 Credit Card

a. Open the Customer Information form. Click Next record in the Navigation bar at thebottom several times to advance through the records.

Take note that the customers are in Customer ID order.

b. Click First record in the Navigation bar to return to customer Abel & Young.

C. Click the Customer Name field, and then click Ascending in the Sort & Filter group.

d. Click Next record in the Navigation bar at the bottom to advance through the records.

The records are now in Customer Name order.

6. Close the Customer Information form.

f. Click the File tab, and then click Compact & Repair Database.

g. Keep the database onscreen if you plan to continue with Hands-On Exercise 2. If not, closethe database and exit Access.

CHAPTER 4 • Creating and Using Professional Forms and Reports