View Full Version : Select item in Combo Box


miki
11-08-2001, 06:52 AM
How i can select item in Combo Box by code?

thanks!!!

diversoln
11-08-2001, 08:07 AM
If you want to set a value for the combo box in an event procedure, you could use something like this:

Dim strComboValue As String
strComboValue = "Your choice here"
[forms]![yourform]![comboboxname] = strComboValue


If the combo box contains numeric or date data, be sure to dimension your variable accordingly.

You could also set a default value for your combo box using properties.

Fizzio
11-08-2001, 01:14 PM
You can also select by where it is in the list by using [forms]![yourform]![comboboxname].itemdata(n) where n is the number of the data (starts at 0)