Fundamentals of Designing a Table
|
|
|
|
In our introductions to Windows controls, we learned how
to position some objects on a form or a report and how to specify their
sizes. These two aspects (the location and the size) are referred to as
characteristics of an object. In computer programming or in application
development, a property is a piece of information that describes an object.
Therefore, a property can be the location (position) of an object, its size,
its color, its text, or anything that characterizes it. Some properties of
an object are visible and can be set by you the database developer. Some
properties can be set or changed by the user when interacting with the
computer (but you should be able to predict or control what the user can or
should do). Some other properties can be changed by either you or the user.
|
As seen in the previous lessons, there are various
ways you can change the properties of a control but the table, the form,
or the report must be displaying in Design View. The properties of an
object can be accessed from the Properties window. The table on one hand
has a different way of dealing with properties than the form or report on
the other hand.
Practical
Learning: Introducing Properties
|
|
- Start Microsoft Access
- To create a new database, click File and click Blank Database
- Set the name of the database to Hotel Management and click
Create
- To save the default table, right-click the Table1 tab and click
Save
- Set the name to Employees and press Enter
|
The Design View of a Table
|
|
When we studied the creation of tables in
Lesson 2, we saw how to
create columns in the Datasheet View. Like the form or the report, the
table can be presented in Design View. In fact, that's probably the best
place to create the columns of a table. Instead of the Datasheet View, you
can start a new table in Design View or you can modify an existing table
in the Design View:
- To start creating a table in Design View, on the Ribbon, click
Create. In the Tables section, click the Table Design button

- To open an existing table in Design View, in the Navigation Pane,
right-click it and click Design View
- If a table is already opened, to switch it to Design View,
right-click its tab and click Design View
- If a table is currently opened, to switch it to Design View, on
the right side of the status bar, click the Design View button

Mostly you, the database developer, have access to the
Design View of a table. The user will hardly, if ever, use that view.
Practical
Learning: Introducing the Table's Design View
|
|
- To switch the table to Design View, right click the Employees tab
and click Design View
A table in Design View is divided in two sections: one
in the upper area and another in the bottom:
The top area is made of columns (named Field Name,
Data Type, and Description) and rows. When necessary, you will be directed
to type or select something in one of the cells. The name of the column
under which you must type or select will be specified in the lessons.
The lower portion of the window is made of two
sections. To access the lower portion while the top section has focus, you
can press F6 or click the lower item you want.
The left section of the lower part is made of two tabs
labeled General and Lookup. Each tab contains two columns and various
rows. The number of rows and the contents of cells depend on what is
selected in the upper section. In our instructions, you will be directed
when to do something in a tab or in a cell. As mentioned for the
Properties window, the left column of the tabs in the lower section lists
the names of characteristics. You cannot change the name of a property.
The right column contains the values of the characteristics. When prompted
to so so, you will create a new value, modify an existing value, or select
one from a combo box. In some cases, a wizard will assist you with
creating an expression as the value of a property.
The right side of the bottom part of the table is made
of a read-only area that describes what is selected in one of the tabs of
the lower-left section.
When given an instruction, you will be dealing with
items in the top or the bottom section. To work on an item, sometimes you
will be asked to click it to give it focus. You can then click the desired
item. Another technique you can use to move from one section to the other
is to press F6.
|
Introduction to Tables Columns Design
|
|
In Lessons 2 and 3, we had various introductions on
how to create tables, forms, and reports. We also learned how to name
them. We learned how to populate tables with columns and how to add fields
to forms or reports with Windows controls but we did not go into their
details as they relate to the operation system. One of the rules to
observe in application or database development is that every object must
have a name.
In our introduction to tables, we saw how to create a
column in the Datasheet View. In the Design View:
- To create a new column and give it a name, click an empty cell
under Field Name and type the desired name
- To change the name of an existing column, double-click its name in
the Field Name column to select it and type the desired name
- To edit the name of an existing column, click somewhere in the
name to put it into edit, use the Delete, the Backspace, and the arrow
keys to edit it
Practical
Learning: Creating Table's Columns in Design New
|
|
- Under the Field Name column header, double-click ID, type
EmployeeID and press Enter
- Click the empty box under EmployeeID, type DateHired
- Press the down arrow key and type EmployeeNumber
- Complete the columns as follows:
| EmployeeID |
| DateHired |
| EmployeeNumber |
| FirstName |
| MiddleInitial |
| LastName |
| MaritalStatus |
- To save the table, press Ctrl + S
|
The Visibility of a Column
|
|
An object such as a column is referred to as visible
if it can visually be located on the screen. A user can use a column only
if it is visible. When reviewing tables, we saw that, to hide a column,
you could right-click it and click Hide Column. To hide a group of
columns, you can right-click any column and click Unhide Column... Then,
in the Unhide Column dialog box, clear the check box of any column you
want to hide.
If you hide a column and save the table, the column is
still available although it is not visible at a particular time. Also, if
you hide a column, it has no influence on the form or report that is based
on the table. This means that a column can be hidden from a table but its
corresponding control on a form or report would still show it. In fact, if
you display the Field List of a form or report that has the Record Source
specified, all of the columns of the table would display in the Field
List, even if they are hidden on the table.
When a field receives focus, you can display a
sentence on the status bar to provide some guidance or suggestion to the
user. The text that displays on the status bar should be explicit enough
but not too long. When creating it, make sure it can fit in the left
section of the status bar, which should be long enough to explain
anything.
The process of creating a status bar text depends on
the control. To create a status bar text for a field when designing a
table:
- If the table is displaying in the Datasheet View, click any cell
under its header. On the Ribbon, click Fields, in the Properties
section, click Name & Caption. Click Description and type the
desired text
- If the table is displaying in the Design View, click the name of
the column. Under Description, type the string you want
The string would appear when the field receives focus
in the table in Datasheet ViewIf the field participates in an expression
for a field of a query, the status bar text would not appear.
To create a status bar text for a field on a form,
while in Design View, access the Status Bar Text property of the
control and type the desired string. Only the controls that can receive
focus have a Status Bar Text property. For the same reason, because
no field can receive focus on a report, this property is not available for
fields on a report.
Practical
Learning: Setting Status Bar Text for Fields
|
|
- In the top section of the table, click EmployeeID and press Tab
twice
- In the Description field for the EmployeeID field,
type
Automatic number generated by the database engine
- Press the down arrow key. That puts the caret in the Description
field for the DateHired field. Type
Date the employee
was officially hired
- In the left section, click MiddleInitial, click the box
under the Description column that corresponds to MiddleInitial, and
type Middle initial made of one letter
- Press Ctrl + S to save the table
- To switch the table to Datasheet View, right-click its tab and
click Datasheet View
When we studied tables creation, we saw how to create
columns and we saw how to set the string on the header portion of a
column. On a column of a table, a caption is the string that the user sees
on the column header. The caption that a column displays is not
necessarily the name of the column.
By default, when you create a column of a table in the
Datasheet View, the string you specify for the column will represent both
its name and its caption. In some cases, you will need or want to display
a multi-word string as the caption of a column. This is because the
caption should be as explicit and simple as possible. For example, it is
better for the user to read Date of Birth than DateOfBirth,
or Full Name instead of FullName.
We already saw how to specify the
name of a column in the Design View of a table. To specify the caption
of a column:
- In the Datasheet View of a table, click any cell under the column
header. In the Properties section of the Fields tab of the Ribbon,
click the Name & Caption button
.
This would display the Enter Fields Properties dialog box where you
can make changes
- To s in the top section of the Design View, click the field under
the Field Name column. In the lower section of the window, click
Caption and type the desired word or group of words
- To change the caption of a column but keep its name, switch the
table to Design View, under Field Name, click the field. In the lower
section of the window, click Caption, press F2 and edit the
string
Practical
Learning: Setting Objects Captions
|
|
- Notice the words in the columns headers (the captions)

- Enter the following records:
| DateHired |
EmployeeNumber |
FirstName |
MiddleInitial |
LastName |
MaritalStatus |
| 08/12/2008 |
297-497 |
Arlene |
P |
Bonds |
Married |
| 10/25/2010 |
406-153 |
Jeremy |
H |
Kaminski |
|
| 05/06/2010 |
927-597 |
Thomas |
|
Jacobson |
Single |
| 07/10/2010 |
759-027 |
Christie |
A |
Aronson |
Married |
| 07/10/2006 |
394-759 |
Carlton |
|
Huge |
Divorced |
| 02/22/2004 |
927-406 |
Patricia |
D |
Thorn |
Single |
| 03/02/2009 |
294-759 |
Justine |
S |
Garland |
|

- To switch the table to Design View, right-click the tab of the
table and click Design View
- In the top section of the table, click EmployeeID
- In the lower section of the view, click Caption
- Type Empl ID and press Enter
- In the top section, click DateHired and press F6
- Press the arrow keys to put the caret on Caption and type
Date Hired
- Press F6 to up to the upper part
- User the arrow keys to select FirstName
- Press F6, select Caption and type First Name
- In the upper section, click LastName
- In the lower section, click Caption and type Last Name
- In the same way, set the Caption of MaritalStatus to
Marital Status
- To save the table, press Ctrl + S
- Right-click the tab of the table and click Datasheet View
- Click a cell under EmployeeNumber
- On the Ribbon, click Fields
- In the Properties section, click the Name & Caption button

- In the Enter Fields Properties dialog box, click Caption and type
Empl #
- Click Description and type A unique number assigned to an
employee

- Click OK
- Click a box under MiddleInitial
- On the Ribbon, click Name & Caption

- Click Caption and type MI

- Click OK
- Right-click the column header of each column and click Field
Width. Then click Best Fit

|
The Font on the Fields of a Table
|
|
A font is an art effect made of designed symbols used
to represent letters and other characters on a field, a control or a
label. A font is designed by an artist but usually follows a specific
pattern. For example, a font designed to produce symbols readable in the
US English language must be designed by a set of predetermined and agreed
upon symbols. These English symbols are grouped in an entity called the
English alphabet. When designing such a font, the symbols created must
conform to that language. Because a font is primarily an art, one font can
be different from another and a font is not necessarily a series of
readable symbols.
Just like everything else in the computer, a font
must have a name. A font is also designed to assume different sizes.
Before using it on a data field or label, the font must have been
installed. Microsoft Windows installs many fonts during setup.
The
font used on the Microsoft Access application to display its menu and the
names of objects is controlled by the operating system. Unless you have a
good reason, you should not be concerned with it.
The names of fonts installed on your computer can be
seen in the Fonts window accessible from Control Panel. Here is an
example:
Microsoft Access uses some default fonts to display
columns and fields on tables, forms, and reports. If you want to use a
different font to display text on labels and fields of your database, you
can changes these defaults. When changing the default font, in other words
if you decide to change the default font, you should use only the most
popular fonts that are more likely to be found on your user�s computers.
|
The Fonts of Columns of a Table
|
|
When designing a table, Microsoft Office Access
applies a default font (named Calibri) to the headers of the columns. If
you want, you can change it. To assist you with setting the fonts of
columns, the Ribbon is equipped with a Text Formatting section in the Home
tab.
To change the font of columns and records of a table,
display the table in Datasheet View. On the Ribbon, click Home. In the
Text Formatting section, click the Font combo box and select the desired
font. The font you select will be applied to all columns and all values
(the records) of the table. The font you apply to a table does not have
any influence on the form(s) or report(s) that are, or will be, based on
that table.
Practical
Learning: Setting the Font of a Table
|
|
- The Employees table should still be displaying in Datasheet View.
On the Ribbon, click Home if necessary.
In the Text Formatting
section, click the arrow of the Font combo box (the top-left combo box
of the Text Formatting section) and click Garamond

- Press Ctrl + S to save the table
Besides its name, a font is also known for its size.
The size defines how much height and proportional width would be used to
represent the characters of the selected font.
To specify the font size of the columns, open the
table in Datasheet View. On the Ribbon, click Home. In the Text Formatting
section, click the arrow of the Font Size combo box and select the desired
size. The font size you apply to a table does not have any influence on
the controls on the form(s) or report(s) that are, or will be, based on
that table.
When a font is installed, a set of font sizes is
created in the Font Size combo box. You can use those numbers but you can
also set a new one. To do this, instead of selecting a value in the Font
Size combo box, type the desired number and press Enter or Tab. The
operating system would calculate the size and apply it.
Practical
Learning: Setting the Font Size of a Table
|
|
- The Employees table should still be displaying in Datasheet View.
In the Text Formatting section of the Home tab of the Ribbon, click
the arrow of the Font Size combo box (the top-right combo box of the
Text Formatting section) and click 12

- Press Ctrl + S to save the table
Another aspect of the appearance of a font is its
style, which is a technique of drawing the characters of the text,
depending on the font. This characteristic comes in four options:
| Style |
Example |
| Regular |
Regular Text |
| Bold |
This text is bold |
| Italic |
Italicized section |
| Underline |
The words are underlined |
The font style applies only to a control that can
display text. When you add a text-based control to a form or a report, by
default, Microsoft Access applies the Regular font style to it. You can
change this characteristic if you want. To change the font style of a
control, switch the form or report to Design View. Select the control or
the group of controls. On the Ribbon, click either Home or Design. In the
Text Formatting section, click the button that represents the desired
style:
Bold

,
Italic

,
or
Underline

.
You can specify more than one style on a control. To
do this, click the button of the desired style. When a style is valid for
a control, when you click that control, the style button is highlighted:

,

,
or

.
To remove a style, click the undesired button. To add a style to another
style, simply click the desired button. Based on this, you can have one,
two or three buttons highlighted in the combination of your choice.
Instead of the buttons on the Ribbon, you can apply a
style or a combination of styles using the Properties window. To do this,
access the Properties window for the control. If you want to apply the
style to many controls, select them and access the Properties window for
the group of selected controls. In the Properties window, click either the
Format or the All tab:
- To set a bold style, click the arrow of the Font Weight
combo box and click its arrow to select one of the following options:
Extra Light, Light, Normal, Medium,
Semi Bold, Bold, Extra Bold, and Heavy
- By default, text is not italicized. This aspect it controlled by
the Font Italic Boolean property whose default value is No. To
italicize a text, set this property to Yes
- By default, the text of a new control is not underlined. This
characteristic is controlled by the Font Underline Boolean
property and its default value is No. If you want to underline the
control or the text of the selected controls, you can set this
property to Yes
As reviewed for the style buttons on the Ribbon, you
can apply various styles using the Properties window. To do this, access
the Properties window for the control or the group of controls and use the
Font Weight, the Font Italic, or the Font Underline properties to set the
styles as desired.
Practical
Learning: Setting the Font Size of a Table
|
|
- The Employees table should still be displaying in Datasheet View.
In the Text Formatting section of the Home tab of the Ribbon, click
the Bold
button

No comments:
Post a Comment