|
You will usually not provide tables to the users for
data entry. Instead, you will use objects called forms. A form appears in a
view friendlier than that of a table. Here is an example of a form presented
to a user:

For you as the database developer, a form only serves as
a relay between the source of data, which can be a table, and the user who
looks at it. Of course, in order to have a form in your application, you
must first create it.
When it comes to data of a database, there are two broad
types of form: data-unrelated and data-related.
Although most of the forms you will use in a database
are meant to display data from a table, you can create an independent form
whose functionality and behavior do not depend on the data from a database.
Such a form can be used to display other types of information to the user.
The form can be referred to as unrelated.
To create a blank form, on the Ribbon, click Create and,
in the forms section, click Blank Form. You would be presented with an empty
rectangular object.
The other category of form involves those used to
display data to the user. Such forms are primarily made for data entry.
Before creating such a form, you must decide where data would come from. The
source object can be a table or other means we will study in future lessons.
If the data of a form will be based on a table, you can specify it, before
or while creating the form.
To easily create a form that would display data, in the
Navigation Pane, select the table. In the Ribbon, click Create. In the Forms
section, click Form.
|
Practical
Learning: Creating a Form Automatically
|
|
- The Cruise2 database should still be opened.
In the Navigation
Pane, click New Cabins: Table to select the table
- On the Ribbon, click Create
- In the Forms section, click Form
Like a table, you can create a temporary form to test
something and get rid of the form after use (you do this by not saving the
form). As done for a table, if you intend to preserve a form, you must save
it. To save a form:
- You can right-click its tab and click Save
- You can attempt closing the form. You would be prompted to save the
form
If the form was not saved previously, you would be
prompted to give it a name. Like every object of a database, a form must
have a name. Microsoft Access is very flexible when it comes to names of
objects. For example, a form can be named D#%bb or 5&#GM* or anything like
that. As you can imagine, such names are not realistic. For this reason, you
should give easily recognizable names to your form so you would be able to
predict what the form is used for. If a form is based on a table, it may be
a good idea to give the same name as the table. If a form is independent,
that is, if it doesn't display data from a table, you can give it a name
that reflects its role in the database.
|
Practical
Learning: Naming a Form
|
|
- On the form tab, right-click Cabins and click Save
- Accept the suggested name for the form as New Cabins.
Click OK
- Close the form
For a typical database, a form is used to view, enter,
manipulate, and search data. Because users spend a great deal of their time
looking at forms, you should create and make them as attractive and friendly
as possible. Form design can take a long time in database development but
Microsoft Access provides quick means to get around. The Form Wizard
provides an easy and fast means of creating a form.
To launch the Form Wizard, on the Ribbon, click Create.
In the Forms section, click Form Wizard. This would start the wizard. The
first page of the Form Wizard allows you to choose the originating table
that will supply the necessary fields in the form. Once you have selected
the object, its corresponding fields display in the Available Fields list
box, you can select all fields or decide which ones you want to include in
the form. The 2nd page of the wizard allows you to select the desired layout
of the form. The 3rd page of the Form Wizard allows you to name the form.
|
Practical
Learning: Using the Form Wizard
|
|
- The Cruise2 database should still be opened.
On the Ribbon, click
Create
- In the Forms section of the Ribbon, click Form Wizard

- In the first page of the wizard, in the Tables/Queries combo box,
select Table: Cabins
- In the first page of the wizard, click the Select All Fields button


- Click Next

- Click Next

- Accept the name of the form as Cabins and click Finish
An
automatic form is created for you
- To close the form as a Windows object, click its Close button

Data entry of a database is mainly performed on forms as
they provide a friendlier display of information than tables. Data entry on
a form is performed using various types of Windows controls. On text boxes,
the user enters data by typing it. On a combo box, depending on how the
object was configured by the database developer, the user may have to only
select an item from the list. In some other cases, the user may be allowed
to enter new data.
After entering or changing data on a control, to move
from one field to the next, the surest way is to press Tab. On most
occasions, the user can also press Enter. The Enter key may not move the
focus from a text box that allows multiple lines of text. If the user is
simply reviewing data without performing data entry, the keyboard's arrow
keys can also be used to move among fields.
|
Practical
Learning: Form Data Entry
|
|
- To create a new database, click File and click New
- Set the Name to BCR1 and and click Create
- Double-click ID and type CustomerID
- Right-click Click to Add and click Text
- Type Full Name and press Enter
- In the menu that appears, click Text, type Driver's License #
and press Enter
- In the menu that appears, click Text, type Address and press
Tab
- In the menu that appears, click Text, type City and press
Enter
- In the menu that appears, click Text, type State and press
Tab
- In the menu that appears, click Text, type ZIP Code and press
Enter
- To save the table, right-click Table1 and click Close
- When asked whether you want to save it, click Yes
- Set the Name to Customers and press Enter
- To create a new form, on the Ribbon, click Create
- In the Forms section, click click Form Wizard
- In the Tables/Query combo box of the first page of the Form Wizard,
select Table: Customers
- Click the Select All button
and click Next
- Accept the Columnar Layout and click Next
- In the style page, select Paper and click Next
- Accept the suggested name of the form as Customers and click Finish
- Click the text box on the right side of Full Name and type
Ernestine Aarons
- Press Tab and type A-682-638-146
- Press Enter and type 6044 Lolita Drive
- Moved to the next record
- Click the text box on the right side of Full Name and type
Raymond Simms
- Click the Next Record button
to get to the next record
- Click the text box on the right side of Driver's License # and type
837-62-5860
- Click the Previous Record button
twice to return to the first record
- Complete the form with the following records:
| Full Name |
Driver's License # |
Address |
City |
State |
ZIP Code |
| Ernestine Aarons |
A-682-638-146 |
6044 Lolita Drive |
Silver Spring |
MD |
20904 |
| Raymond Simms |
629-49-2746 |
815 Arundela Rd NE |
Washington |
DC |
20008 |
| Johnny Edmondson |
837-62-5860 |
10696 Great Alberta Crt |
Alexandria |
VA |
21233 |
| Albert Faughty |
F-374-590-749-205 |
702 Mechanics Drv |
College Park |
MD |
20707 |
- To close the form, click its close button

|
Finding and Replacing
Data
|
|
Editing a value consists of changing it. This can be
done on the table or the form (or on a query as we will learn). To do this,
first locate the value in the field. If you are working on a table, you can
click the value and use the keys (left, right, Home, End, Backspace, or the
Space Bar) to edit the value. If you are working on a form, you can click
the label next to a field. This would completely select the corresponding
value in the control. You can then press F2 to position the caret in the
control and edit its value. Alternatively, you can click the control's field
and edit the value.
|
Practical
Learning: Editing Data
|
|
- From the resources that accompany these lessons, open the Ceil Inn2
database
- In the Navigation Pane, double-click Customers: Table to open it
- In record number 2, click the empty box under Emergency Name
- Type Albert Lomey and press Enter
- Close the table
- In the Navigation Pane, under Customers: Table, double-click
Customer to open the form
- Click the Next Record button once
to navigate to the second record
- Click the Emergency Name label and type 301-412-5055
- Close the form
Sometimes there will be some regular problems in
your database. For example during data entry, some information could
be missing, mistyped, or entered in the wrong field. These problems
would be easy to locate on a small table or form. If the database
grows, values could become difficult to locate. Fortunately,
Microsoft Access provides many tools you can use to find values and
take actions.
To assist you with finding a value in a table or
a form, the Home tab of the Ribbon is equipped with a section named
Find:

To start looking for a value, you can click the Find
button
or you can press Ctrl + F. This would open the Find and Replace dialog box
with the Find tab selected:

The Find and Replace dialog box is modeless, meaning you
can access the table or form in the background while the dialog box is
present.
To specify the value to look for, type it in the Find
What combo box. If you had previously used the dialog box, the Find What
combo box keeps track of the previous searches and stores them in the
control. This would allow you to perform a search on a value previously
used.
The Look In combo box allows you to select the column
where the value should be located. By default, when the Find and Replace
dialog box displays, it selects the column or field that had focus and puts
its name in the Look In combo box. You can look into that column but, if you
want to search the whole table, select its name in the Look In combo box.
The Match combo box allows you to specify how close the
match should be. The options are Any Part of Field, Whole Field (the
default), and Start of Field.
The Search combo box allows you to specify the direction
to follow. The options are Up, Down, and All (the default).
After specifying the options, you can click Find Next.
After using the Find and Replace dialog box, to dismiss it, you can click
Cancel or press Esc.
|
Practical
Learning: Editing Data
|
|
- The Ceil Inn5 database should still be opened.
In the Navigation
Pane, double-click Customers: Table to open it
- In the Find section of the Ribbon, click the Find button

- In the Find What combo box, type Carney
- In the Look In combo box, select Customers
- In the Match combo box, select Any Part of Field

- Click Find Next
- Click Find Next again. Notice that a second result is found
- In the second result, while the Find and Replace dialog box is still
opened, on the table, click the found Carney and press Tab three times
to get to its Emergency Phone
- Press F2 to position the caret in the cell and edit it to display
990-326-5144
- In the Find and Replace dialog box, replace Carney with Beckins
- Click Find Next.
Notice that the Phone # of that record is
incomplete
- Click the right side of the incomplete telephone number and type
1440 to make it 410-944-1440
- Click the Find and Replace dialog box
We have seen that you can use the Find and Replace
dialog box to simply locate a value. Instead of just finding it, you may
want to replace the found value with an alternate. To assist you with this,
you can use the Replace section of the dialog box. To get it, in the Find
section of the Ribbon, you can click the Replace button
or you can press Ctrl + H. This would open the Find and Replace dialog box
with the Replace tab selected:

You can also open the Find and Replace dialog box as we
did for finding, then click the Replace tab.
The Replace section of the dialog box provides the same
options at the Find counterpart with the addition of the Replace With combo
box, the Replace and the Replace All buttons. After specifying what to look
for in the Find What combo box, the Replace With combo box allows you to
specify the value to replace the Find What with.
|
Practical
Learning: Editing Data
|
|
- The Ceil Inn5 database should still be opened.
In the Navigation
Pane, double-click Customers: Table to open it
- In the Find section of the Ribbon, click the Replace button

- In the Find What combo box, type ratner
- In the Replace With combo box, type Rattner
- In the Look In combo box, select Customers
- In the Match combo box, select Any Part of Field

- Click Find Next
- Once the value is found, click Replace
- Close the Find and Replace dialog box and close the table
- In the Navigation Pane, under Customers: Table, double-click the
Customers form
- Press Ctrl + H to display the Replace dialog box
- In the Find What combo box, replace the string with Annie and
press Tab
- In the Replace With combo box, type Annette
- Make sure the Look In combo box displays Customers and make sure the
Match combo box is set to Any Part of Field.
Click Find Next
- Once a match is found, click Replace All
- Click the right side of the incomplete telephone number and type
1440 to make it 410-944-1440
- Close the Find and Replace dialog box and close the form
|
Introduction to
Record Printing
|
|
The primary function of the table is to provide a means
of storing and arranging information of a database. Nevertheless, you can
print data of a table, especially if for example you are in a hurry and do
not have access to another object. You can print data on a table whether the
table is opened or not.
To print a closed table, locate it in the Navigation
Pane and click it to select it, then click File, position the mouse on Print
and select one of the three options. In the same way, if the table is opened
in Datasheet View, click its tab to give it focus, then click File -> Print
and select to print or to preview.
The Print menu of the Office Button presents three
options:
- If you click Print, the Print dialog box would be presented to you.
It allows you to specify the printer you want to use. Most of the time,
the Name combo box will present the default printer; otherwise, you can
select one:

After specifying the printer, if you are ready to print, you
can click OK. To customize the printing job, you can click Properties. A
dialog box, whose contents depend on the selected printer, would come
up. Among the various options you would have is that of specifying the
orientation of the paper (Portrait or Landscape). Again, remember that
different printers provide different features.
After setting the properties of the printer, you can click OK. Once
you are ready to print, you can click OK on the Print dialog box to send
the job to the printer
- If you select Quick Print from the Print menu of the Office Button,
the print job would be sent directly to the printer. Microsoft Access
would use the default printer that is set in Control Panel and would use
the previous settings that were set on that default printer
- If you select Print Preview, Microsoft Access would draw a print job
on the screen for you. This allows you to see what the final job would
look like on the paper. The characters on the screen may appear too
small for you. To zoom in, you can click the middle of the window. To
zoom out, you can click it again. Once you are ready to print, on the
Ribbon and in the Print section, you can click Print. This would send
the print job to the printer
|
Practical
Learning: Printing Tables
|
|
- In the Navigation Pane, click Customers: Table to select the table
- To print data from the table, click File, position the mouse on
Print and click Quick Print
- From the Navigation Pane, double-click the Company Assets table to
open it
- click File, position the mouse on Print and click Print
- Select the desired printer Name combo box and click Properties
- Based on your printer, select the Landscape radio button (usually in
the Orientation section of a Paper Layout tab) and click OK
- On the Print dialog box, click OK
- Close the table
Although not part of their primary role, forms provide a
quick means of printing data, especially in the absence of desired reports.
There are various issues related to printing forms, including printing all
records or just some of them.
You can print a form without opening it. Once you know
the form you would like to print, locate its name in the Navigation Pane and
use the same steps reviewed for a table.
When a form is opened, you have the option of printing
all of its records or the selected one. In the Form View, to print just one
record, navigate to the record you would like to print, click the Form
Selection bar to select the record and proceed to print.
|
Practical
Learning: Printing Forms
|
|
- From the Navigation Pane, under Customers: Table, double-click the
Customers form to open it
- click File, position the mouse on Print and click Quick Print
- To navigate to the 3rd customer, click the Next Record button
twice
- click File -> Print -> Print
- On the Print dialog box, click the Selected Record(s) radio
button
- Click OK
- Verify that only the displaying customer's record was printed
- Close the Customers form
- Open the Cruise2 database you were working on earlier
- In the Navigation Pane, under Cabins, double-click Cabins
- We will print records from 3 to 7.
Click the Next Record button
twice navigate to record number 3
- Click the Record Selector bar

- Press and hold Shift. Click the Next Record button
four times to display the seventh record where the Cabin ID field would
display 7 (even though the record # still displays 3)
- Release Shift
- On the Ribbon, click File -> Print -> Print
- On the Print dialog box, click the Selected Record(s) radio
button and click OK
- Verify that records from 3 to 7 have been printed
- Close the Cabins form
A report provides an object used to print a database's
records. Although you can print tables or forms, reports are customized to
be printer friendly. They can perform and display calculations. Once again,
Microsoft Access provides wizards to quickly create reports.
Microsoft Access can help you quickly create a report
using one of the pre-designed layouts. This is done using the Report Wizard.
The Report Wizard is available from the Reports section of the Create
category of the Ribbon.
|
Practical
Learning: Using the Report Wizard
|
|
- On the Ribbon, click Create
- In the Reports section, click Report Wizard
- On the first page of the wizard, click the arrow of the
Tables/Queries combo box and select Table: Cabins
- Click the Select All Fields button


- Click Next

- Accept anything in the second page and click Next

- Accept anything in the third page and click Next
- In the Layout section, click the Columnar radio button:

- Click Next

- Accept the suggested Title of the report as Cabins and press Enter

The report is the favorite object used to print data. As
done with the other objects, you can print a report whether it is opened or
not. Before printing a report, you must first select or open it. If you want
to print a report without opening it, in the Navigation Pane, locate the
desired report and click it to select it. Then, proceed from the Office
Button as we reviewed for the table and the form. In the same way, you can
first open the report from the Navigation Pane and use the Print menu from
the Office Button the same way we described for the other objects.
|
Practical
Learning: Printing a Report
|
|
- The Cabins report should still be opened.
click File, position
the mouse on Print and click Print Preview
- To start the printing process, in the Print section of the Print
Preview, click Print
- On the Print dialog box, select the printer and make sure the All
radio button is selected
- Click Properties, click the Portrait radio button (in the
Orientation section) and click OK
- To send the print job to the printer, on the Print dialog box, click
OK
- Close the Employees report
- Open the Yugo National Bank1
- Open the AccountTypes table fill it up as follows:
| Account Type ID |
Account Type |
Description |
| 1 |
Checking |
|
| 2 |
Saving |
|
| 3 |
CD |
|
- Print the table and close it
- Create a blank database and name it Watts A Loan1
- Create a table with the following fields: TransactionID (you
will rename the ID column), TransactionNumber, TransactionDate,
TransactionAmount, and Notes. Save the table as
Transactions
- Open the World Statistics1 database
- Use the Table button in the Tables section of the Ribbon to create a
new table with the following fields: CountryID, CommonName,
InternetCode, LongName, and GovernmentType
- Save the table as Countries and switch it to Design View
|
|