ACC1x: Default Values Used Only with a Bound Control

ID: Q109325


The information in this article applies to:


SYMPTOMS

If a form's underlying dynaset contains a field that has a default value, the default value will not be used if there is no control bound to the field.


RESOLUTION

A control on the form must be bound to the field in order for the default value to be used when a new record is added.


STATUS

This behavior no longer occurs in Microsoft Access version 2.0. In Microsoft Access 2.0, properties from tables are inherited, while in version 1.1 table properties are not inherited.


MORE INFORMATION

Steps to Reproduce Behavior


  1. Open the sample database NWIND.MDB.


  2. Create a new form based on the Order Details table. Include all the fields except Quantity (which has a default value of 1) on the form.


  3. View the form in Form view. Add the following new records:
    
          Order ID   Product ID   Unit Price   Discount
          ---------------------------------------------
           12000     19           1.00         25% 


  4. From the File menu, choose Save Record.


  5. Open the Order Details table in Datasheet view. Note that the Quantity column is blank for the records you added, even though this field has a default value of 1.



REFERENCES

Microsoft Access "User's Guide," Version 1.0, pages 216-217

Microsoft Access "User's Guide," Version 1.1, pages 220-222


Keywords          : kbusage TblFldp 
Version           : 1.0 1.1
Platform          : WINDOWS 
Issue type        : kbprb 

Last Reviewed: March 30, 1999