LO3 - Creating Database Forms
LO3 - Creating Database Forms
Ethiopian TVET-System
Level II
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
Learning Activities
1. Read the specific objectives of this Learning Guide.
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.
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.
Combo Box
List Box
Sub Report/
Sub Form
Rectangle Unbounded Object Frame
Insert Page File Attachment
Bounded Object Frame
Option Button Image
Check Box
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.
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.
In many cases, it's quicker and easier to select a value from a list than to remember a value to type.
List boxes:
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.
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:
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:
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.
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.
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.
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.
3. Is a screen that allows you to enter, change, and view the data in a database? (1 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)
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
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.
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
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.
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.
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.
You can use the Multiple Items button on the Forms tab to create a form that displays multiple records,
one record per row.
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.
After you create a form, it opens in Layout view, where you can modify it.
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
To resize a datasheet
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.
When you create a form, by default, Access uses the form name as the title. You can change the title.
You can easily add the date and time to your form.
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 to percent.
Add gridlines.
Add a logo.
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 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
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