Adding field objects to a form or report

Fields are the most common design objects you can add to forms and reports. You can add a labeled field and edit fields to forms and reports. You can add a list box, combo box, radio button, or check box to a form. You can also add special fields to a form or report. A special field in a form or report contains information about the table or about the design as a whole. You also have the option of protecting or hiding the data in a field object.

In this section, you'll learn about

  adding fields and special fields to a form or report
  
  specifying edit and labeled field objects
  
  specifying combo, radio button, list, and check box field objects
  
  protecting and hiding data in a field
  
Adding fields and special fields to a form or report

You can add field objects and special fields to a form or report. A special field in a form or report contains information about the table or about the design as a whole. For example, a special field can be added to display a page number. A special field is not directly related to a field in a table, but it can be related to a table or a table design. For example, a special field can be defined to display a table's name. It is important to note that special fields cannot be edited. In addition, you can add fields using the Field palette instead of using the menu.

To add a field object to a form or report

1	Click Insert  Field.

2	Click in the design window.

If you need to move the field object, drag it to a new position in the design window.

Note

  When you insert a field object, it has a default size and shape. If you need to resize the field object, point to a selection handle and drag it to resize the object. For information about sizing and shaping objects, see "Sizing and shaping design objects."
  
Tip

  You can also add a field object by clicking the Field tool on the toolbar.
  
To add a field object to a form or report by using the Field palette

1	Click View  Field palette.

2	Choose a table from the table's list box.

3	Click a field in the Field palette list.

4	Click Add.

You can also	

Choose a table from a different folder	Click Browse. Choose the drive and folder where the table is stored.

Choose an alias	Click Browse. Choose an alias from the alias list box.

View information about the table's structure	Click Info.

Tip

  You can add a field from the Field palette list by dragging it to the design window.
  
To add a special table-related field to a form or report

1	Click Insert  Field.

2	Click in the design window.

If you need to move the field object, drag it to a new position in the design window.

3	Right-click the field object and click Define field.

4	From the table's list box, choose one of the following special fields:

  <Table Name> - represents the table's name
  
  <Record Number> - represents the current record number
  
  <Number of Records> - represents the number of records in the table
  
  <Number of Fields> - represents the number of fields in the table
  
Note

  To define a field, the form or report must be connected to a data model.
  
To add a special design-related field related to a form or report

1	Click Insert  Field.

2	Click in the design window.

If you need to move the Field object, drag it to a new position in the design window.

3	Right-click the field object, and click Define field.

4	From the Special field list box, choose one of the following special field types:

  Date - represents today's date
  
  Now - represents the current time
  
  Page number - represents a page number
  
  Timestamp - represents the current time and date
  
  Number of pages - represents the number of pages in the form or report
  
Note

  To define a field, the form or report must be connected to a data model.
  
Defining field objects

After adding a field object to a form or report, you must define the field so that it is linked to a field in a table in your data model. When you run the form or report, the data from the table field displays. If you are adding a list, combo field, radio button, or check box field object to a form, you can specify the values that the field object will display. For more information about specifying values, see "Specifying combo, radio button, list, and check box field objects."

To define a field object

1	Right-click the field object, and click Define field.

The Define field object dialog box displays a list box for each table used in the form.

2	Choose a field from the appropriate table's list box.

Note

  To define a field, the form or report must be connected to a data model. You can choose a data model from the Define field object dialog box by clicking Data model.
  
Specifying edit and labeled field objects

When you add a field object to a form or report, you can specify that the object be an edit or labeled field object. Both edit fields and labeled fields allow others to view table data or enter data in a table when the form is run. To view or edit table data, the form must be associated with a data model. Edit and labeled fields are useful for viewing data from a specific table field one record at a time. Instead of selecting the records from a list, you can use the navigation buttons to move through the records. The only difference between an edit and labeled field object is that the label field object is labeled.

To specify an edit field object

1	Right-click the field object, and click Properties.

2	Click the General tab.

3	In the Display type area, choose Edit from the list box.

You can also	

Navigate table records forwards when the form is run using the keyboard	Click the edit field object, and press F12.

Navigate table records backwards when the form is run using the keyboard	Click the edit field object, and press F11.

Edit a record in an edit field when the form is run	Press F9, and edit the record in the edit field.

Note

  If you change display types from an unlabeled field to a labeled field without enabling the Size to fit check box on the Design page of the Properties dialog box, the field remains the same size and the label object and field object compete for space. When you enable the Size to fit check box, the field object expands to accommodate the new label. For more information about sizing a field object, see "To size a field object."
  
To specify a labeled field object

1	Right-click the field object, and click Properties.

2	Click the General tab.

3	In the Display type area, choose Labeled from the list box.

You can also	

Navigate table records forwards when the form is run using the keyboard	Click the labeled field object, and press F12.

Navigate table records backwards when the form is run using the keyboard	Click the labeled field object, and press F11.

Edit a record in a labeled field when the form is run	Press F9, and edit the record in the field.

Note

  By default, the name of the field you chose from the table displays as the field object's label. If you want to edit the label, click the labeled field object to select it and click the label.
  
Specifying combo, radio button, list, and check box field objects

When you add a field object to a form, you can specify that the object be a combo, radio button, list, or check box field object. If you specify one of these field object display types, you need to define the values that display in the field object when the form is run. For example, if you create a country list, you need to specify the country names that display in the list when the form is run.

When you run a form and enter data using a combo-box field, you can type a value in the edit region, or choose a data value from the list box. For example, if you create a data entry form for a customer order table, you can use a combo box field to display a list of payment method options.

Paradox also gives you the option of adding a list field, which lets others view a list of values from which to choose and only the values listed can be selected. In addition, only one value can be selected at a time. You can use a list field object to provide others with a quick way of entering data in a field that has a specific number of valid values. For example, if you create a data entry form for a customer orders table, you can use a list field object to display a list of shipping methods.

You can also add radio buttons to display a list of values from which to choose. Each value is displayed next to a radio button. When the form is run, a person using the form can enable a button to select a value from the list.

You can also add a check box field object to a form. When a form is run, a check box can be enabled or disabled. If the check box is enabled, a check mark displays in the box; when disabled, the box is blank. You can assign a value when the check box is enabled and another value when it's disabled. The value you assign is entered in the table when someone enables or disables the check box.

A logical field type is a perfect candidate for a check box display type. It's also a good idea to create a default validity check on the logical field and to specify false as the default value. For all fields other than logical fields, any values can be entered for the check box values. For example, suppose you design a form using the Vendors sample table. The preferred field, a logical field, indicates whether the vendor has preferred status or not. You could define the field as a check box, and define the values for the check box as "true" when enabled and "false" when left blank. If the user enables the box, "true" is entered into the table's field for that record. If the user leaves the box disabled, a "false" value is entered.

To specify a combo field object

1	Right-click the field object, and click Properties.

2	Click the General tab.

3	In the Display type area, choose Combo from the list box.

4	Click Define values.

5	In the Define list of values dialog box, type the items that you want to display as choices in the combo box in the Item box and press ENTER after each entry.

This adds the items to the Item list.

You can also	

Sort the items in the list alphabetically	Click Sort list.

Modify an item in the Item list	Click an item in the Item list. Click Modify item.

Remove an item from the Item list	Click an item in the Item list. Click Remove item.

Note

  If you change display types from an unlabeled field to a labeled field without enabling the Size to fit check box on the Design page of the Properties dialog box, the field remains the same size and the label object and field object compete for space. When you enable Size to fit, the field object expands to accommodate the new label. For more information about sizing a field object, see "To size a field object."
  
To specify a radio button field object

1	Right-click the field object, and click Properties.

2	Click the General tab.

3	In the Display type area, choose Radio button from the list box.

4	Click Define values.

5	In the Define list of values dialog box, type the items that you want to display as radio button options in the Item box and press ENTER for each entry.

This adds the items to the Item list.

You can also	

Sorts the items in the list alphabetically	Click Sort list.

Modify an item in the Item list	Click an item in the item list. Click Modify item.

Remove an item from the Item list	Click an item in the Item list. Click Remove item.

Note

  If you change display types from an unlabeled field to a labeled field without enabling the Size to fit check box on the Design page of the Properties dialog box, the field remains the same size and the label object and field object compete for space. When you enable Size to fit, the field object expands to accommodate the new label. For more information about sizing a field object, see "To size a field object."
  
To specify a list field object

1	Right-click the field object, and click Properties.

2	Click the General tab.

3	In the Display type area, choose List from the list box.

4	Click Define values.

5	In the Define list of values dialog box, type the items that you want to display as choices in the list in the Item box press ENTER for each entry.

This adds the items to the Item list.

You can also	

Sorts the items in the list alphabetically	Click Sort list.

Modify an item in the Item list	Click an item in the item list. Click Modify item.

Remove an item from the Item list	Click an item in the Item list. Click Remove item.

To specify a check box field object

1	Right-click the field object, and click Properties.

2	Click the General tab.

3	In the Display type area, choose Check box from the list box.

4	Click Define values.

5	In the Check box values dialog box, type the value that you want entered into the table when the person enables the check box in the Value when checked box.

6	Type the value you want entered in the table when the user does not enable the check box in the Value when blank box.

Notes

  If you do not enter a value in the Value when blank box, a value will not be entered in the table.
  
  If you change display types from an unlabeled field to a labeled field without enabling the Size to fit check box on the Design page of the Properties dialog box, the field remains the same size and the label object and field object compete for space. When you enable Size to fit, the field object expands to accommodate the new label. For more information about sizing a field object, see "To size a field object."
  
Protecting and hiding data in a field

Paradox lets you control how a field displays on a form when the form is run. For example, you can protect a field from being edited and you can also suppress the contents of a field. This means that a field is visible, but the contents entered in it are not. This option is especially useful when entering passwords or other protected information.

To protect the contents of a field from being edited

1	Right-click the field, and click Properties.

2	Click the Run time tab.

3	In the Run mode area, enable the Read only check box.

To hide a field's contents

1	Right-click the field, and click Properties.

2	Click the Run time tab.

3	In the Run mode area, enable the No echo check box.




