Combo box default value - Help! 
Author Message
 Combo box default value - Help!

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?

TIA
Dave



Mon, 29 Oct 2001 03:00:00 GMT  
 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      |
-------------------------



Mon, 29 Oct 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to set default value of combo box to value of record in database

2. default value in combo box to last selected

3. Default Value in Combo Box?

4. Default value for dropdown combo list box?

5. setting a default value to a Combo box

6. Default Values for Combo Box Style 2

7. Combo boxes don't default to current value

8. Populate a Combo Box with default value...

9. Default value for Combo Box!

10. enter data in a combo box based on value from another combo box

11. Help filling second combo box from fist combo box

12. ASP Question - Need help in setting Drop Down Box default values

 

 
Powered by phpBB® Forum Software