learning microsoft access 2007 forms

12
Learning Microsoſt Access 2007 By Greg Bowden Guided Computer Tutorials www.gct.com.au Chapter 5 Creating More Detailed Forms

Upload: ismirtukulija

Post on 27-Oct-2014

197 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Learning Microsoft Access 2007 Forms

Learning Microsoft Access 2007By Greg Bowden

Guided Computer Tutorialswww.gct.com.au

Chapter 5

Creating More Detailed Forms

Page 2: Learning Microsoft Access 2007 Forms

PUBLISHED BY

GUIDED COMPUTER TUTORIALSPO Box 311Belmont, Victoria, 3216, Australia

www.gct.com.au

© Greg Bowden

This product is available in Single or Multi User versions.

Single-user versions are for single person use at any particular time, just as a single text book would be used. If you intend to use the notes with multiple students the single user version should be upgraded to the multi-user version.

Multi-user versions allow the school or institution to print as many copies as required, or to place the PDF files on the school network, intranet and staff laptops. A certificate of authentication is provided with multi-user versions. Bookmarks provide links to all headings and sub-headings, and individual chapters are provided.

First published 2008

ISBN: 1 921217 52 9 (Module 1) 1 921217 53 7 (Module 2) PDF document on CD-ROM

Every effort has been made to ensure that images used in this publication are free of copyright, but there may be instances where this has not been possible. Guided Computer Tutorials would welcome any information that would redress this situation.

Page 3: Learning Microsoft Access 2007 Forms

© Guided Computer Tutorials 2008 5-1

Chapter

5Creating More Detailed FormsWhen databases become larger it is necessary to be able move fields anywhere on the screen so that all the data can be clearly seen. Access allows you to produce professional-looking screen displays which can be printed or simply designed to make data entry easier. Fields can be moved, graphics, shadings and pictures added, etc. The easier the data entry process is made the less chance there is of incorrect data being entered. In this chapter you will create a data entry form for a department store using DESIGN VIEW.

Starting a New Database

1 If you are starting a fresh session, load Microsoft Access.

2 If you are continuing directly from the previous chapter, close the current file.

3 In the Access GETTING STARTED screen click on the BLANK DATABASE icon in the NEW BLANK DATABASE section.

4 In the BLANK DATABASE pane enter the file name BIG CITY, ensure that your STORAGE folder is select underneath it (use the BROWSE button to access it if necessary) then click on CREATE.

Page 4: Learning Microsoft Access 2007 Forms

© Guided Computer Tutorials 20085-2

Learning Microsoft Access 2007

Defining the Fields

2 Enter the following Field Names, Data Types and Descriptions:

Item Code Text Enter the item’s code Item Name Text Enter the item’s name Department Text Enter the item’s Department Description Text Enter a description of the item Cost Price Currency Enter the cost price of the item Retail Price Currency Enter the retail price of the item Dealer Text Enter the dealer’s name and address Photo OLE Object Import a picture of the item

NOTE: i An OLE Object field allows graphics, sounds or videos to be stored in the field.

ii The descriptions of the fields is not essential, however, the descriptions that you do enter will appear at the bottom of the screen when a field is selected, providing assistance to the person entering the data.

iii We could have adjusted the field sizes of all the fields, but the default settings will suffice for this activity.

1 Open the CREATE tab in the RIBBON and click on the TABLE DESIGN icon to start a new table.

3 Your field definitions should look like this.

Page 5: Learning Microsoft Access 2007 Forms

© Guided Computer Tutorials 2008 5-3

5Creating More Detailed Forms

Deleting the First Table

The first table that access provides when you start a database can be deleted.

2 The table will be deleted as no fields have been entered into it.

3 Close the DATA table.

4 The table needs to be saved. Click on the SAVE icon in the QUICK ACCESS TOOLBAR, enter the table name:

Data

and select OK.

5 You will be asked to set a PRIMARY KEY. This is not necessary for this activity so select NO.

1 Click on the TABLE 1 tab then RIGHT+CLICK on its icon and select CLOSE.

Page 6: Learning Microsoft Access 2007 Forms

© Guided Computer Tutorials 20085-4

Learning Microsoft Access 2007

Starting the Form

The FORMS section of the program allows you to control how the data will be displayed on the screen. The one database can have several different forms. We will create a form that displays all the fields on the one screen. In this case we will create the form in DESIGN VIEW.

A Opening the Form in Design View

1 Open the CREATE tab in the RIBBON and click on the FORM DESIGN icon.

2 The form is opened in DESIGN VIEW which has a grid in the DETAIL section and rulers at the top and left.

Page 7: Learning Microsoft Access 2007 Forms

© Guided Computer Tutorials 2008 5-5

5Creating More Detailed Forms

NOTE: When creating a detailed data entry screen, usually as much of the screen as possible is used.

B Linking the Form to the Data Table

When creating a form in DESIGN VIEW the table or query that stores the data must be specified.

3 Move the pointer over the bottom right corner of the grid. The cursor should change to a cross hair with arrows. Hold down the mouse button and drag the corner to the bottom right corner of the screen.

Click on the PROPERTY SHEET icon in the RIBBON to open the PROPERTY SHEET pane and, in the DATA tab, set the RECORD SOURCE box to the DATA table.

Page 8: Learning Microsoft Access 2007 Forms

© Guided Computer Tutorials 20085-6

Learning Microsoft Access 2007

C Setting the Grid

The grid that is provided can be changed to show less dots.

Inserting Fields

Fields and labels can be placed anywhere on the screen. The purpose of a data entry screen is to make the data as easy as possible to view and enter, so time is usually taken to make data entry screens look attractive.

1 In the PROPERTIES SHEET pane open the FORMAT tab.

2 Set the GRID X and GRID Y boxes, which are near the bottom of the list, to 4 so that there are 4 dots per cm.

1 Click on the ADD EXISTING FIELDS icon in the RIBBON and the FIELDS LIST pane replaces the PROPERTY SHEET pane.

2 You can drag the left border of the pane to the right to reduce the width of the FIELD LIST pane if you wish.

Page 9: Learning Microsoft Access 2007 Forms

© Guided Computer Tutorials 2008 5-7

5Creating More Detailed Forms

NOTE: The co-ordinates on the grid are read as (11,1). That is 11 cm in the top ruler and 1 cm in the left ruler.

3 Select the ITEM CODE field in the FIELD LIST pane then drag the field (which attaches to the pointer) to be in line with 11 cm in the top ruler and 1 cm in the left ruler.

4 Select the ITEM NAME field from the FIELD LIST pane and drag it to (4,3). That is, so that its top left corner is in line with 4 cm in the top ruler and 3 cm in the left ruler.

5 Drag the DEPARTMENT field to (11,3).

Page 10: Learning Microsoft Access 2007 Forms

© Guided Computer Tutorials 20085-8

Learning Microsoft Access 2007

Understanding the Handles

When you drag a field into the form, a series of ‘handles’ are placed around the field box. These ‘handles’ allow the object (call a control in Access) to be moved or resized. The following diagram summarises the ‘handles’.

2 Press CTRL+Z to undo the move and return the label to its original position.

4 Press CTRL+Z to undo the move and return the field box to its original position.

1 Move the pointer over the DEPARTMENT label’s move ‘handle’, the large ‘handle’ at the top left of the label until an arrowed cross-hair is added to it then drag the label up and to the left. Only the DEPARTMENT label moves.

3 Try moving just the DEPARTMENT field box using its move ‘handle’.

Move ‘handles’ Resize ‘handles’

Field boxField Label

Page 11: Learning Microsoft Access 2007 Forms

© Guided Computer Tutorials 2008 5-9

5Creating More Detailed Forms

6 Press CRTL+Z to return the field and its label to their original position.

NOTE: This will make the DESCRIPTION field wider and longer so that more text can be seen on the screen.

5 Move the pointer over the border of the DEPARTMENT field box (not over a ‘handle’ ) until the arrowed cross-hair is added to it and drag the DEPARTMENT field box to another position on the screen. Both the DEPARTMENT field box and its label should move.

7 Drag the DESCRIPTION field from the FIELD LIST pane to (4,4).

8 Move the pointer over the bottom right ‘handle’ of the DESCRIPTION field box until it changes to diagonal arrows and drag the ‘handle’ to (14,5).

Page 12: Learning Microsoft Access 2007 Forms

© Guided Computer Tutorials 20085-10

Learning Microsoft Access 2007

Saving the Form

You should save the form regularly as you build it. Microsoft Access saves any data that you enter into a form automatically, but it does not save any of the designing that you carry out.

Looking at the Form

It is good practice to regularly look at how the form is shaping up as you build it. Any obvious errors can be adjusted early.

1 Click on the SAVE icon in the QUICK ACCESS TOOLBAR, call the form:

Data Entry

and select OK to save the form.

2 Use the arrow next to the TABLES heading in the NAVIGATION pane to set it the ALL ACCESS OBJECTS so that you can see the table and the form.

1 Click on the VIEW icon in the RIBBON at the top left of the FORM window (not the arrow at its base) and your screen should be changed to FORM VIEW. This is where the data is entered.