Navigation:  Articles > Nov-1997 >

Tip: Default Value Magic

Previous pageReturn to chapter overviewNext page

Jeremy Burns          
You can define a field in a table or on a form to contain a default value. The result is that, if the user goes to a new record in a form, the default values are already displayed. I know from sitting with users that this can cause confusion.
You can get the benefits of default fields without incurring this confusion. A solution I use is to have a duplicate field hidden on the form with the same control source as the field the user is to fill in. Now you can set the default value in the hidden field, not the visible field. On a new record, the default value isn't displayed in the visible field until the user types the first character of the new record. Then, the default value from the hidden field is recorded in the underlying table. As the control source of both the visible and invisible fields is the same, the value now stored in the table will appear in the visible field. To a user, it appears as if the system has automatically completed some fields for him by magic. Unfortunately, if the default value property is set at the table level, this method won't work, but it might be possible to move the default value property from the table to the form.