Access 2007
Making Forms More Usable with Controls
Setting field properties
Sometimes it may be necessary to set field properties from the form itself. For example, on the New Orders form for our bookstore shown below, we want to set up the Order Date field to auto-fill with the current date each time an order is entered. This way, our employees will not have to worry about entering a date on the form because the form will do it for them.
To set field properties from a form
To set a field property for a form in Design View:
- Highlight the appropriate field on the form.
- Open the Property Sheet.
- Verify that the Field Name appears in the Selection type drop-down list.
- Set the desired field property.
In our example, we want to set the Order Date field to auto-fill with the current date. Refer to the picture below. Notice that we have the Order Date field highlighted on the form itself. On the Property Sheet, we have Order Date showing in the Selection type drop-down list.
Because we want the Order Date to auto-fill, we must set the default value to always enter the current date.
To set a field to auto-fill with the current date
To set the Order Date field to automatically enter the current date in our database:
- Open the Data tab on the field's Property Sheet.
Setting Order Date to Auto-fill with Current Date - Set the Default Value property by clicking on the Expression Builder button.
- Use Expression Builder to enter the expression for the current date. It looks like this:
Expression for Current Date
The Expression Builder contains many commonly used expressions for database functions. Explore them by clicking on the various files in the lefthand column.