Freigeben über


Fields Tab, Table Designer

The Fields tab displays slightly different information depending on whether you open a database table or a free table. If you are creating a database table, the Fields tab includes options for setting validation rules. If you are creating a free table, the Fields tab contains only basic field name, type, and formatting options.

The Fields tab displays table fields in a scrollable grid. Each row contains the field's name, data type, character width, decimal width, and support for null values. Click a cell in the grid to modify a field.

  • Mover Button
    This is the double-headed arrow button at the extreme left of the row. Once you have entered two or more rows, use the mover button to move a row up or down in the list.

  • Name
    Specifies the name of the field. Spaces are not accepted. For database tables, the length of the name can be up to 128 characters. For more information, see Visual FoxPro Name Creation.

  • Type
    Specifies the field's data type. Click the drop-down arrow to select a data type from the list.

  • Width
    Specifies the number of characters or digits the field can store.

  • Decimal
    Specifies the number of digits to the right of the decimal point. The Decimal column applies to numeric and double data types.

  • Index
    Specifies a regular index on the field for ordering the data.

  • NULL
    When checked, specifies that the field can accept a null value.

  • Insert Button
    Inserts a new field above the selected field.

  • Delete Button
    Deletes the selected field from the table.

  • Display
    Specifies the format properties for entering and displaying the field.

Format Specifies the expression for case, size, and style for display of the field in the Browse window, forms, or reports. Property settings within the form and report can override this expression.

Input mask Specifies the format for values as they are entered into the field. For example, telephone numbers might have a format of (999) 999-9999.

Caption Specifies the label that appears for the field in the Browse window, forms, or reports. Property settings within the form or report can override this setting. To specify an expression for a field caption, include an equal sign (=) preceding the caption string. Expressions cannot exceed 254 characters. If the expression exceeds 254 characters, the caption defaults to the field name.

> **Note**    Support for using expressions as field captions should be used only with DBC tables in applications running on Visual FoxPro 8.0 or later. In earlier versions, the expression appears as a string literal.
  • Field validation
    If you are modifying a database table, the Field Properties option group appears below the scrollable grid.

    Properties settings for the selected field are specified in this area. Choose the dialog button to the right of each property setting to display the Expression Builder Dialog Box, or just type the expression directly. Entries for these options are not required.

Rule Specifies the field-level rule for enforcing data validation.

Message Specifies the error message to be displayed if an entry violates the field-level validation rule.

Default value Specifies the default value for the field.

  • Map field type to classes
    To specify a default control class, set the library and class you want to create when you drag the field onto a form.

Display library Specifies the path and file name for the class library. To browse for a file, use the dialog button.

Display class Specifies the default control class for the field.

  • AutoIncrement
    To set the start and increment values after enabling autoincrementing for a field, select values from the Next Value and Step spin boxes. For more information about autoincrementing, see Autoincrementing Field Values in Tables.

Next Value Specifies the start value for a field using autoincrementing. You can select a positive or a negative integer value from 2,147,483,647 to -2,147,483,647. The default value is 1.

Step Specifies the increment value for a field using autoincrementing. You can select a positive, nonzero integer value from 1 to 255. The default value is 1.

  • Field comment
    Provides a space to enter notes about the field.

See Also

Expression Builder Dialog Box | Indexes Tab, Table Designer | Table Wizard | Visual FoxPro Name Creation | Table Designer