Sei sulla pagina 1di 24

Ethiopian TVET System

Training, Teaching and Learning Material

Ethiopian TVET-System

INFORMATION TECHNOLOGY SUPPORT SERVICE

Level II

LEARNING GUIDE # 1

Unit of Competence: Operate Database Application


Module Title: Operating Database Application
LG Code: ICT ITS2 LO1 01
TTLM Code: ICT ITS2 TTLM 0511

LO 3: Create database Forms


TTLM Development Manual Date: 05-2011 Page 1 of 24
3rd Revision Author: ADDIS ABABA TEGBARE-ID
Ethiopian TVET System
Training, Teaching and Learning Material
Introduction Learning Guide # 1

 This learning guide was developed to provide you the necessary information regarding the following
 Opening and designing DB application and principles
 Creating DB objects
 This guide will also assist you & you will be able to

 Open and design database application incorporating basic design principles


 Create database object according to database usage, as well as user requirements
 Modify database object as required
 Add and modify data in a table according to information requirements
 Add, modify and delete records as required & Save and compile database objects

Learning Activities
1. Read the specific objectives of this Learning Guide.

2. Read the information written in the “Information Sheets 1”.

3. Accomplish the “Self-check1”.

4. Submit your accomplished Self-check1. This will form part of your training portfolio/range.

5. Read the “Operation Sheet” and try to understand the procedures discussed.

6. Do the “LAP test” (if you are ready) and show your output to your teacher. Your teacher will evaluate
your output either satisfactory or unsatisfactory. If unsatisfactory, your teacher shall advice you on
additional work. But if satisfactory you can proceed to Learning Outcome 4.

TTLM Development Manual Date: 05-2011 Page 2 of 24


3rd Revision Author: ADDIS ABABA TEGBARE-ID
Ethiopian TVET System
Training, Teaching and Learning Material

Information Sheet-1 Creating Database Forms

Forms

 A form is a screen that allows you to enter, change, and view the data in a database.
 Think of forms as windows into your data that help users understand and work with that data.
 Let's take a quick look at what goes into a form:
 Forms are made up of controls, such as text boxes, buttons, document tabs, and drop-down
lists, grouped in a way that makes them easy to use and helps you get work done.
 The controls in the form are usually bound, or connected, to the tables or queries in your
database — but not always. For example, a control that displays your corporate logo doesn't
have to be bound to a table field. It can just point to the image it displays.
 In addition to entering data, you can use forms in other ways. For example, you can create a form that
asks for input, and then generates a custom report based on that input.
 In Access 2007, a form is an object that generally serves three purposes:

1. To allow users to perform data entry. Data can be inserted, updated, or deleted from a table using a
Form object.
2. To allow users to enter custom information, and based on that information perform a task. For
example, you may want to ask a user for parameters before running a report.
3. To allow users a method of navigating through the system. For example, you may create a form
where a user can select a form to load, a report to run, etc.

 A form is a type of a database object that is primarily used to enter or display data in a database.
 Most forms are bound to one or more tables and queries in the database.
 A form's record source refers to the fields in the underlying tables and queries.
Forms may be created by either:
 Form wizard
 Design view
Creating Forms using a wizard
 Creation of a form by using a wizard is the Ms Access pre-defined way of creating a form by simply
following the series of steps and choosing which field and format you would want for your form.
TTLM Development Manual Date: 05-2011 Page 3 of 24
3rd Revision Author: ADDIS ABABA TEGBARE-ID
Ethiopian TVET System
Training, Teaching and Learning Material
Creating Forms using design view
 Creation of a form by design view is a user customized way of making data entry forms, Switchboard
form and even custom dialog box.
 Each control in the design view of a form was being dragged from the control toolbox.

Customizing data access page (Form) layout and settings


 Before proceeding to creating a data access page or a form, it is important to understand the different
tools that you can use in setting up and modifying your data access pages.
 The most important tools can be found in the Controls.
 This can be dragged anywhere you want to place it on your screen.
 These are the following tools in the Toolbox.

Toggle Option Hyperlink


Page Break More Control
Line Tab Control
Option Group
Chart

Combo Box

List Box

Sub Report/
Sub Form
Rectangle Unbounded Object Frame
Insert Page File Attachment
Bounded Object Frame
Option Button Image
Check Box

TTLM Development Manual Date: 05-2011 Page 4 of 24


3rd Revision Author: ADDIS ABABA TEGBARE-ID
Ethiopian TVET System
Training, Teaching and Learning Material

Types of controls in Access

 Microsoft Access includes the following types of controls, which are all accessible through the toolbox
in Design view of a form, report, or data access page: text box, label, option group, option button,
check box, list box, command button, tab control, image control, line, rectangle, and ActiveX custom
controls.
 You can also add a Microsoft Office PivotTable list, an Office Chart, or an Office Spreadsheet to a form,
report, or data access page.
 Forms and reports have these additional controls: toggle button, combo box, bound object frame,
unbound object frame, and page break.
 You can also add a sub form or sub report to a form or report.
 Data access pages also include the drop-down list box, hyperlinks, scrolling text, and the PivotTable
list, spreadsheet, and chart components.
 Controls are objects on a form, report, or data access page that display data, perform actions, or are
used for decoration.
 For example, you can use a text box on a form, report, or data access page to display data, a command
button on a form to open another form or report, or a line or rectangle to separate and group controls
to make them more readable.
 All the information on a form or report is contained in controls.
 On data access pages, information is contained in controls in the same way as it is on forms and
reports.
 However, information can also be typed directly on the data access page.

Controls that you can use to display, enter, filter, or organize data in Access

Text boxes:
 You use text boxes on a form, report, or data access page to display data from a record source.
 This type of text box is called a bound text box because it's bound to data in a field.
 Text boxes can also be unbound.
 For example, you can create an unbound text box to display the results of a calculation or to accept
input from a user. Data in an unbound text box isn't stored anywhere.

TTLM Development Manual Date: 05-2011 Page 5 of 24


3rd Revision Author: ADDIS ABABA TEGBARE-ID
Ethiopian TVET System
Training, Teaching and Learning Material

Labels:
 You use labels on a form, report, or data access page to display descriptive text such as titles, captions,
or brief instructions.
 Labels don't display values from fields or expressions; they're always unbound and they don't change
as you move from record to record.
 A label can be attached to another control.
 When you create a text box, for example, it has an attached label that displays a caption for that text
box. This label appears as a column heading in the Datasheet view of a form.
 When you create a label by using the Label tool, the label stands on its own— it isn't attached to any
other control.
 You use stand-alone labels for information such as the title of a form, report, or data access page, or
for other descriptive text. Stand-alone labels don't appear in Datasheet view.

List boxes, combo boxes and drop-down list boxes:

 In many cases, it's quicker and easier to select a value from a list than to remember a value to type.

List boxes:

 The list in a list box consists of rows of data.


 In a form, a list box can have one or more columns, which can appear with or without headings.
 If a multiple-column list box is bound, Access stores the values from one of the columns.
 In a data access page, a list box has one column without a heading.

Combo boxes:

 A combo box is like a text box and a list box combined, so it requires less room.
 You can type new values in it, as well as select values from a list.
 The list in a combo box consists of rows of data.
 Rows can have one or more columns, which can appear with or without headings.

TTLM Development Manual Date: 05-2011 Page 6 of 24


3rd Revision Author: ADDIS ABABA TEGBARE-ID
Ethiopian TVET System
Training, Teaching and Learning Material
Drop-down list boxes:

 On a data access page, you can use a drop-down list box instead of a list box.
 A drop-down list box on a data access page looks like a combo box on a form.
 As in a combo box, a drop-down list box shows only one record until you click to expand the contents;
however, you can't type new values in a drop-down list box.
 The list in a drop-down list box consists of rows of data. Rows can have only one column that appears
without headings.

Command buttons:

 Provide you with a way of performing action(s) by simply clicking them.


 When you choose the button, it not only carries out the appropriate action, it also looks as if it's being
pushed in and released.

What are command buttons?

 You use a command button on a form or data access page to start an action or a set of actions.
 For example, you can create a command button that opens another form.
 To make a command button do something on a form, you write a macro or event procedure and
attach it to the button's OnClick property.
 On a data access page, you can attach code written in either Microsoft JScript or Microsoft Visual Basic
Scripting Edition (VBScript) to a command button by using the Microsoft Script Editor.
 You can display text or a picture on a command button in a form; you can display only text on a
command button in a data access page.
 By using the wizard, you can create more than 30 different types of command buttons. You can create
command buttons to:

 Dial a phone number.  Print or mail a report.


 Run a query or macro.  Print the current record.
 Run or quit an application.  Update form data.
 Edit or apply a filter.  Find a specific record.

TTLM Development Manual Date: 05-2011 Page 7 of 24


3rd Revision Author: ADDIS ABABA TEGBARE-ID
Ethiopian TVET System
Training, Teaching and Learning Material
Check box:

 You can use a check box on a form, report, or data access page as a stand-alone control to display a
Yes/No value from an underlying table, query, or SQL statement.
 For example, the check box in the following illustration is bound to the Discontinued field in the
Products table.
 The data type of the Discontinued field is Yes/No. If the box contains a check mark, the value is Yes; if
it doesn't, the value is No.
 This stand-alone check box is bound to the Discontinued field in the Products table.
 You can use check boxes in an option group to display values to choose from.

Option Buttons:

 You can use an option button on a form, report, or data access page as a stand-alone control to display
a Yes/No value from an underlying record source.
 For example, the option button in the following illustration is bound to the Discontinued field in the
Products table of a database. The data type of the Discontinued field is Yes/No. If the option button is
selected, the value is Yes; if not, the value is No.
 This stand-alone option button is bound to the Discontinued field in the Products table. The value in
the field is Yes.
 Only one option in an option group can be selected at a time.

Option groups:

 You can use an option group on a form, report, or data access page to display a limited set of
alternatives.
 An option group makes selecting a value easy because you can just click the value that you want.
 Only one option in an option group can be selected at a time.
 If you want to present more than a few options, use a list box, a combo box, or a drop-down list box
instead of an option group.
 In a form or report, an option group consists of a group frame as well as a set of check boxes, option
buttons, or toggle buttons.
 In a data access page, an option group consists of a group frame and a set of option buttons.
TTLM Development Manual Date: 05-2011 Page 8 of 24
3rd Revision Author: ADDIS ABABA TEGBARE-ID
Ethiopian TVET System
Training, Teaching and Learning Material
Toggle buttons:

 You can use a toggle button on a form as a stand-alone control to display a Yes/No value from an
underlying record source.
 For example, the toggle button in the following illustration is bound to the Discontinued field in the
Products table of a database.
 The data type of the Discontinued field is Yes/No.
 When the button is pressed in, the value in the Products table is Yes. When the button isn't pressed in,
the value in the Products table is No.
 This stand-alone toggle button is bound to the Discontinued field in the Products table. The button is
pressed in, so the value in the field is Yes.

Tabbed pages on forms:

 You can use a tab control to present several pages of information as a single set.
 This is especially useful when you're working with many controls that can be sorted into two or more
categories.
 For example, you might use a tab control on an Employees form to separate employment history and
personal information.
 Information about employment history is displayed on this page.
 Personal information, such as home address and phone number, is displayed on this page.

Additional controls that you can use on data access pages

Hyperlink control:

 Use the Hyperlink control when each record in the underlying record source has a different hyperlink
address.
 You bind the hyperlink control to a Text field that contains hyperlink values, such as e-mail addresses.
 As you move from record to record in Page view or Microsoft Internet Explorer, you can click the
hyperlink to either go to a different Web page or open a mail program to send an e-mail message.

TTLM Development Manual Date: 05-2011 Page 9 of 24


3rd Revision Author: ADDIS ABABA TEGBARE-ID
Ethiopian TVET System
Training, Teaching and Learning Material
Image hyperlink control:

 Use the image hyperlink control to add an image to a data access page that, when clicked, displays
another Web page from your hard drive, the Web, or another location. When you create an image
hyperlink control, you select the image to display on the page and the address of the file to jump to.
 In Page view, as the pointer passes over the image, the pointer changes to a hand, indicating that the
image is a link that you can click to go to another page. You can also define ScreenTips and alternate
text for the image.
 The image hyperlink control is useful for providing links to information that relates to data on your
data access page.

TTLM Development Manual Date: 05-2011 Page 10 of 24


3rd Revision Author: ADDIS ABABA TEGBARE-ID
Ethiopian TVET System
Training, Teaching and Learning Material

Self - Check 1 Creating Database Forms

Name: ______________________________________ Date: ________________________________________

Time started: _______________________________ Time finished: _______________________________

Directions: Answer all the questions listed below.

1. Form is made up of? (1 points)

2. Way of creating forms? (2 Point)

3. Is a screen that allows you to enter, change, and view the data in a database? (1 points)

4. The most important tools can be found in? (1 point)

5. A form is an object that generally serves three purposes? (3 points)

6. List & Discuss on the different types of Controls in MS access? (12 point)

Note: Satisfactory rating – above 17 points Satisfactory & below 16 points Unsatisfactory
(You can ask you teacher for the copy of the correct answer)

TTLM Development Manual Date: 05-2011 Page 11 of 24


3rd Revision Author: ADDIS ABABA TEGBARE-ID
Ethiopian TVET System
Training, Teaching and Learning Material

Self - Check 1 Opening and designing DB application and principles


(Answer Key)

1. Controls
2. A. Form wizard
B. Design view
3. Form
4. Controls
5. A. To allow users to perform data entry.
B. To allow users to enter custom information, and based on that information perform a task.
C. To allow users a method of navigating through the system etc.
6.
Page Break More Control
Line Tab Control
Option Group
Chart

4.
Combo Box 5.
6.
7.
8.
List Box 9.
10.
11.
12.
Sub Report/13.
Sub Form 14.
Rectangle Unbounded Object Frame File Attachment
Insert Page
Bounded Object Frame
Option Button Image
Check Box

TTLM Development Manual Date: 05-2011 Page 12 of 24


3rd Revision Author: ADDIS ABABA TEGBARE-ID
Ethiopian TVET System
Training, Teaching and Learning Material

Operation Sheet Creating Database Forms


Creating Forms

Access forms are much like paper forms: you can use them to enter, edit, or display data. They are
based on tables. When using a form, you can choose the format, the arrangement, and which fields you
want to display. This lesson teaches you how to create forms.

Using the Form Button

Access can automatically create several types of forms. For example, when you click the Form
button on the Create tab, Access places all fields in the selected table on a form. If the table has a one-to-
many relationship with one other table or query, Access creates a stacked form (the records are
displayed in a column) for the primary table and a datasheet for the related table. If there are several
tables with a one-to-many relationship, Access does not create the datasheet.

To create a form

1. Open the Navigation pane.


2. Click the table or query on which you want to base your form.
3. Activate the Create tab.
4. Click Form in the Forms group. Access creates a form.

TTLM Development Manual Date: 05-2011 Page 13 of 24


3rd Revision Author: ADDIS ABABA TEGBARE-ID
Ethiopian TVET System
Training, Teaching and Learning Material

You can use the Navigation bars to move through the records on a form.

1 Go to First Record
2 Go to Previous Record
3 The Current Record
4 Go to Next Record
5 Go to Last Record
6 Create a New (Blank) Record

Tip: After you create a form, you can save it. You can open a saved form at any time.

TTLM Development Manual Date: 05-2011 Page 14 of 24


3rd Revision Author: ADDIS ABABA TEGBARE-ID
Ethiopian TVET System
Training, Teaching and Learning Material
To save a form

1. Click the Save button on the Quick Access toolbar. Access saves the form unless you are saving for
the first time. If you are saving for the first time, the Save As dialog box appears.
2. Type the name you want to give the form.
3. Click OK. Access saves the form. You can now access the form by using the Navigation pane.

You can also save by right-clicking a form’s tab and then selecting Save from the menu that appears.
Access saves the form unless you are saving for the first time. If you are saving for the first time, the Save
As dialog box appears. Type the name you want to give the form and then click OK. Access saves the form.
You can now access the form by using the Navigation pane.

Create a Split Form

A split form is a form in which the same data is displayed in two views simultaneously. One part of
the form displays in Form view (stacked fields), while the other part displays in Datasheet view. The two
views are synchronized, so as you select a field in one view, it is automatically selected in the other view.
You can add, change, or delete the data in either view. Using a split form gives you the benefits of two
types of forms in a single form. For example, you can use the datasheet portion to locate records and the
form portion to edit records.

To create a split form

TTLM Development Manual Date: 05-2011 Page 15 of 24


3rd Revision Author: ADDIS ABABA TEGBARE-ID
Ethiopian TVET System
Training, Teaching and Learning Material
1. Open the Navigation pane.
2. Click the table or query on which you want to base your form.
3. Activate the Create tab.
4. Click Split Form in the Forms group. Access creates a split form.

Create a Multiple Items Form

You can use the Multiple Items button on the Forms tab to create a form that displays multiple records,
one record per row.

To create a multiple items form

TTLM Development Manual Date: 05-2011 Page 16 of 24


3rd Revision Author: ADDIS ABABA TEGBARE-ID
Ethiopian TVET System
Training, Teaching and Learning Material
1. Open the Navigation pane.
2. Click the table or query on which you want to base your form.
3. Activate the Create tab.
4. Click Multiple Items in the Forms group. Access creates a multiple items form.

Tip: A view is a way of looking at an Access object. Forms have three views: Form view, Layout
view, and Design view. You can enter, edit, and view data in Form view. You can modify a form in Layout
view or Design view. In Layout view, you can see your data, and the form you see closely resembles what
your form will look like when you view it in Form view. You can make most, but not all, changes to your
form in Layout view. Design view displays the structure of your form. In this view you cannot see the
underlying data, but you can perform some tasks in Design view that you cannot perform in Layout view.
This tutorial focuses on Layout view.

To change the view

1. Open the form.


2. Activate the Format tab.
3. Click the down-arrow under the View button. A menu appears.
4. Click the view you want.

TTLM Development Manual Date: 05-2011 Page 17 of 24


3rd Revision Author: ADDIS ABABA TEGBARE-ID
Ethiopian TVET System
Training, Teaching and Learning Material
Modify a Form

After you create a form, it opens in Layout view, where you can modify it.

To change the size of a field

1. Click a side of the field and drag to change the width of the field.
2. Click the top or bottom of a field and drag to change the height of a field.

To move a datasheet

1. Click the datasheet to select it.


2. Click and drag the four-sided arrow in the upper-right corner to move the datasheet.

To resize a datasheet

1. Click the datasheet to select it.


2. Click a side of the datasheet and drag to change the width.
3. Click the top or bottom of the datasheet and drag to change the height.

To apply an AutoFormat

The AutoFormat option on the Format tab enables you to apply formats quickly, such as background
colors, field colors, field label colors, and fonts.

1. Activate the Format tab.


2. Click AutoFormat. The AutoFormat menu appears.
3. Click the format you want to apply.

To change a form title

When you create a form, by default, Access uses the form name as the title. You can change the title.

1. Activate the Format tab.


2. Click the Title button.
3. Type the new title.
TTLM Development Manual Date: 05-2011 Page 18 of 24
3rd Revision Author: ADDIS ABABA TEGBARE-ID
Ethiopian TVET System
Training, Teaching and Learning Material
To add the date and time

You can easily add the date and time to your form.

1. Activate the Format tab.


2. Click the Date and Time button. The Date and Time dialog box appears. Select the date and time
format you want. The date and time appear on your form.

Change Fonts and Formats

You can use options on the Format tab to manually apply individual formats to your report. However,
before you can apply a format to a field or field label, you must select it. To select a field or field label,
click it. To select multiple items, hold down the Shift key and then click each item you want to select. A
box surrounds selected items.

Change Fonts and Formats

Button Shortcut Function


Key

Layout View—Format Tab, Font Group

Apply a font to the current selection.

Set the size of the font for the current


selection.

Ctrl-b Bold the current selection.

Ctrl-i Italicize the current selection.

Ctrl-u Underline the current selection.

Ctrl-l Left-align the selection.

Ctrl-r Right-align the selection.

Ctrl-e Center the selection.

Change the font color.

TTLM Development Manual Date: 05-2011 Page 19 of 24


3rd Revision Author: ADDIS ABABA TEGBARE-ID
Ethiopian TVET System
Training, Teaching and Learning Material
Change the background color.

Change the alternating color. For


example, you can have every other row
on a datasheet appear in an alternating
color.

Layout View—Format Tab, Formatting Group

Apply a Number format.

Use a currency symbol.

Change to percent.

Use thousand separators.

Increase decimal places.

Decrease decimal places.

Layout View—Format Tab, Gridlines Group

Add gridlines.

Change the weight of gridlines.

Change the style of gridlines.

Change the color of gridlines.

Layout View—Format Tab, Controls Group

Add a logo.

Add or change a title.

Add a date and time.

Set line thickness.

Set line style.

Set line color.

TTLM Development Manual Date: 05-2011 Page 20 of 24


3rd Revision Author: ADDIS ABABA TEGBARE-ID
Ethiopian TVET System
Training, Teaching and Learning Material

Add a Command Button Using a Control Wizard

Open the form in Design View

1. Verify the Control Wizards command is selected in the Controls group on the Form
Design Tools Design Contextual tab

2. Click the Button command in the Controls group on the Form Design Tools Design
Contextual tab
Click on your form where you want the command button to be inserted

Figure 34. Command Button Wizard - Choose a Category & Action

5. Select a category and action


6. Click Next

TTLM Development Manual Date: 05-2011 Page 21 of 24


3rd Revision Author: ADDIS ABABA TEGBARE-ID
Ethiopian TVET System
Training, Teaching and Learning Material

Figure 35. Command Button Wizard - Choose the Command Button Options
7. Set your command button option
8. Click Next

Figure 36. Command Button Wizard - Choose How the Button Should Work

9. Choose how the button should work


10. Click Next

TTLM Development Manual Date: 05-2011 Page 22 of 24


3rd Revision Author: ADDIS ABABA TEGBARE-ID
Ethiopian TVET System
Training, Teaching and Learning Material

Figure 37. Command Button Wizard - Choose Text or Picture Display


11. Choose to show Text or a Picture on the command button
12. Click Next

Figure 38. Command Button Wizard - Enter Command Button Name

13. Enter a name for the command button


14. Click Finish
15. Save the form
15. Test the new command button

TTLM Development Manual Date: 05-2011 Page 23 of 24


3rd Revision Author: ADDIS ABABA TEGBARE-ID
Ethiopian TVET System
Training, Teaching and Learning Material

LAP Test Creating Database Form

Name: ______________________________________ Date: ________________________________________

Time started: _______________________________ Time finished: _______________________________

1. Name each of the controls (Apply the controls in a form)

2. Create a form
2.1. Create the Navigation Buttons
2.2. Create a label that displays your name
2.3. Create a text box
2.4. Insert Picture
2.5. Insert Chart
2.6. Create a link to open another form
2.7. Create control button that closes the form
2.8. Save the Form

1
2.9.2.1 Open2.2Existing2.3form 2.4 2.5 2.6 2.7 2.8

TTLM Development Manual Date: 05-2011 Page 24 of 24


3rd Revision Author: ADDIS ABABA TEGBARE-ID

Potrebbero piacerti anche