INF: How to Default a Combo Box to the First Row Value

PSS ID Number: Q100924
Article last modified on 11-11-1993

1.00 1.10
WINDOWS

------------------------------------------------------------
The information in this article applies to:

 - Microsoft Access versions 1.0 and 1.1
 - Microsoft Access Distribution Kit version 1.1
------------------------------------------------------------

SUMMARY
=======
Combo boxes based on tables or query values can change frequently. If
you want the combo box to reflect the first row of the table or query
value by default, you can use a domain function.  

MORE INFORMATION
================
The following example demonstrates how to set up a combo box to
default to the first row of a table or query value:
1. Open the sample database NWIND.MDB.
2. Open the Employees form in Design view.
3. From the toolbox, select combo box. Add a combo box to the form.
4. From the View menu, choose Properties.
5. Add the following properties to the form:
      RowSource: Employees
      ColumnCount: 2
      ColumnWidth: 0 in; 1 in;
      BoundColumn: 2
      Default Value: =Dfirst("[Last Name]","Employees")
6. From the View menu, choose Form.
The default value is now set to the first row.

Additional reference words: 1.00 1.10
KBCategory:
KBSubcategory: FrmrptCtlprp GnrlNw
Copyright Microsoft Corporation 1993.