When a control is based on a field from a data source, there are some cases when you want to have a value put in the control automatically when new records are added. This value is called the default value. In a perfect world the default value of a field is specified for the field in the table, located in the database. However, there will be times when it is overlooked, or you want to override the default value set at the database level.
Which type of data you will use as a default value will depend on the data type of the field. The following table displays some example of default values that could be used with the form used in this chapter:
|Region||"WA"||Places the abbreviation for the state of WA in the Region field.|
|Order Date||today()||Use the today() formula to assign today's date.|
|Quantity||1||Setting a numeric value to 1 or 0; this helps to keep users from leaving values blank.|
When set at the form level, default values are just like other values you enter into forms in that you need to click the Submit button to have them saved in the database.
The way to specify default values is to use the property sheet of the control. There are several ways to specify default values. The first way is enter the value you want into the Value entry in the Default Value area on the data tab of the property sheet.
Using the Chapter 6 Starting.xsn ...