ACC: Pressing CTRL+ALT+SPACEBAR Enters Control's Default Value (90138)



The information in this article applies to:

  • Microsoft Access 1.0
  • Microsoft Access 1.1
  • Microsoft Access 2.0

This article was previously published under Q90138
Novice: Requires knowledge of the user interface on single-user computers.

SYMPTOMS

When you create a form based on a table that has one or more fields defined with the DefaultValue property, pressing CTRL+ALT+SPACEBAR inserts the control's default value defined in the form rather than the field's default value defined in the table. If no value has been defined for the control's DefaultValue property, then CTRL+ALT+SPACEBAR has no effect.

When you are entering data in the table's Datasheet view, pressing CTRL+ALT+SPACEBAR inserts the field's default value, as defined in the table.

CAUSE

When you create a form based on a table with one or more fields defined with the DefaultValue property, new controls bound to such fields will have the same DefaultValue property. You can keep this value, change it, or delete it.

When you enter new records in Form view, any control that has a DefaultValue property will be displayed with the control's default value. If you decide that you want to have the default value that was defined in the table, you will have to type it in. In Form view, when you press CTRL+ALT+SPACEBAR, the default value defined for the control is entered.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior


  1. Open the sample database Northwind.mdb (or NWIND.MDB in versions 1.x and 2.0).
  2. Create and save the following new table called TestDefaults:
          Table: TestDefaults
          -------------------
          Field Name: City
             Data Type: Text
          Field Name: State
             Data Type: Text
             DefaultValue: NC
    						
  3. Create a new form in Design view based on the TestDefaults table.
  4. Add the following text box controls to the detail section of the form:
          Text Box:
             Name: txtCity
             ControlSource: City
          Text Box:
             Name: txtState
             ControlSource: State
             DefaultValue: WA
    						
  5. Save the form as frmTestDefaults and close it.
  6. Open the form in Form view. Note that WA defaults in the State field of the first record.
  7. Replace WA with CA in the first record, and save the record.
  8. Delete CA in the State field, and then press CTRL+ALT+SPACEBAR. Note that the form's default value, WA, appears in the State field.

Modification Type:MajorLast Reviewed:5/28/2003
Keywords:kbprb kbusage KB90138