Page 289
FIG. 12.27
Creating a default form
module.
FIG. 12.28
The Object Navigator
after creating a new
blank form. The Blocks
object is highlighted
and the Create icon is
about to be clicked.
Page 290
FIG. 12.29
The New Block Options
dialog box showing the
form settings for the
General Tab sheet.
The next step is to press the Items tab to open the Items tab sheet, shown in Figure 12.30. Press the Select Columns button to populate the item window on the left side of the dialog box with the items from the table named in the previous tab.Then decide which of these fields will appear on the block. By default, all the fields are selected. This is indicated by the plus sign in front of the field or a check mark in the Include checkbox.
In Figure 12.30, the highlighted field, SOCIAL_SECURITY_NUMBER, is displayed but the EMPLOYMENT_DATE field is not. You can select or deselect a field by entering or removing the check mark in the Include checkbox or double-clicking the item in the window.
FIG. 12.30
The New Block Options
dialog box displaying
the Items Tab sheet.
The Label field contains the default boilerplate or text that will be placed in front of the item. You can change this value. The Width field contains the display width of the field
Page 291
on the block. This width is not the size of the database item, but the size of the text item that will display the database item.
The initial value is based on the length of the field in the table. The value of the SOCIAL_SECURITY_NUMBER field in Figure 12.30 is 72.
This means the value is 72 points, not 72 characters. The value in this field conforms to the current metric set in the form properties. One of these properties is the Coordinate system. The Form Coordinate system is currently set to real. The form size metric for real is pixels, centimeters, inches, or points. The Coordinate system can also be changed to character. This will be discussed in Chapter 13, "Formatting Your Form."
The Type field indicates the type of item to be created. Item types are explained in Chapter 14, "Creating and Modifying Master/Detail Forms."
NOTE |
All of the items on the employee table should be selected and labeled to suit.n |
You can press the Layout Tab, shown in Figure 12.30, when you're done with the items. The Style pick list contains two values: Tabular and Form.
The tabular style places each column in a single row with each field adjacent to the other. This style is appropriate for detail blocks that contain multiple records.
The Tools block and Glasses block of the Employee form used in Chapter 11 are examples of a tabular block. The top block containing unique information about the employee is an example of a form style. This style is generally used for master blocks. Figure 12.31 shows a filled out Layout tab sheet you can use for your practice form.
FIG. 12.31
The New Block Options
Layout Tab settings
The Orientation pick list determines the direction the records are laid out in when multiple records are shown on the block. The vertical setting places each additional row below the previous one.
The horizontal setting places each additional record to the right of the previous record. Generally, the vertical setting is used.
The Records item determines the number of records the block displays. The Spacing field controls the amount of space between each item. The values in this field are in character cells.
The Integrity Constraints field tells Designer whether to enforce table and column constraints in the table. This changes block and item properties to match those in the table.