Previous | Table of Contents | Next

Page 289

FIG. 12.27
Creating a default form
module.


  1. Launching the New Block Options dialog box
    The next step is to create a block in the form. This can also be done in several ways. The first is to select the Tools/New Block option on the Tools menu.
    The second is to select and highlight the Blocks keyword on the Object Navigator, as shown in Figure 12.28, then click the Create icon on the tool palette to open the New Block Options dialog box.

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.


    The New Block Options dialog box consists of four tabbed sheets. The sheets contain settings for the new block.
    The tabbed sheets are: General, Items, Layout, and Master/Detail. The dialog box with the General tab is shown in Figure 12.29.
  1. Filling out the General Tab sheet
    The Base Table item contains the name of the table or view that supplies the block with records. If you're not sure of the table name, you can use the Select button to identify the table. This opens a dialog box with the tables you can access.

Page 290

    The Block Name field contains the name of the block. As you tab from the Base Table field, this field is populated with the same name as the Base table. You can change this name.
    The Canvas field contains the name of the canvas. If the form is new, Designer puts a new default canvas name in this field and creates this canvas at the same time as the block. If the form has existing blocks, Designer uses the canvas that was last selected.
    If you want to change the name of the canvas and you don't know the name, you can use the Select button to the right of the field to open a dialog box with the various canvases.
    The Sequence ID field contains the order of block navigation. You use it only when you're creating multiple blocks on the form.
    Figure 12.29 contains a filled out General tab sheet.

FIG. 12.29
The New Block Options
dialog box showing the
form settings for the
General Tab sheet.


  1. Filling out the Items 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
  1. Filling out the Layout tab sheet

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.

Previous | Table of Contents | Next