
Combo box default value - Help!
Quote:
> Hi all,
> I have a combo box that gets its values from an SQL statement:
> the row source is set to:
> SELECT [PO's].ID FROM [PO's] WHERE
> ((([PO's].Requestor)=[form1username])) ORDER BY [PO's].ID;
> When the form is opened, I want the default value for the combo box to
> be the last valid entry for that particular person i.e [form1username].
> On the form load, I can update a text box with the default number I am
> looking for based on the above SQL statement using the SELECT LAST
> statement, but when I try to make the combo box use the value of that
> text box as the default, it doesn't work, it usually defaults somewhere
> in the middle of the list. I can't seem to find any help on the
> 'default' control for the combo box option. Can anyone help me out?
If you are trying to make the default value of the combo box as the last
value of it's rowsource, try using this as a default value:
----
= Me!ComboName.ItemData(Me!ComboName.ListCount - 1)
--
-------------------------
| gHaD (Aaron Robinson) |
|MJM-PC Solutions, Inc. |
| Chicago, IL |
-------------------------