Partager via


How to: Format Output for Fields

You can specify the format used by values in fields from database tables when those values appear on forms, in browse windows, or reports. You can use format codes and characters to specify the format. For more information about format codes and characters, see Format Property.

To specify the format for field output

  1. Open the database containing the table.

  2. Open the table in the Table Designer.

  3. On the Fields tab, select the field that you want.

  4. In the Format box of the Display area, type the format characters that you want.

For more information, see Fields Tab, Table Designer.

To specify the format for field output programmatically

  • Use the DBSETPROP( ) function to set the Format field property.

For more information, see DBSETPROP( ) Function.

For example, the following code specifies the output format for a postal code:

DBSETPROP("Orders.Postalcode","Field","Format","@R 99999-9999")

See Also

Tasks

How to: Open Databases
How to: Edit Table Structure

Other Resources

Working with Fields
Working with Tables (Visual FoxPro)