How to set combobox or listbox to its first item
If the first column is the bound column – then the code would look like this:
Me.Combo1 = Me.Combo1.Column(0, 0)
To set a default value of combobox to its first item you can use similar approach:
Me.Combo1.DefaultValue = Me.Combo1.Column(0, 0)
Me.Combo1 = Me.Combo1.Column(0, 0)
To set a default value of combobox to its first item you can use similar approach:
Me.Combo1.DefaultValue = Me.Combo1.Column(0, 0)
2 Comments:
Bad guess...
Note that BoundColumn property can differ from Combo to combo.
The right one is:
Me.Combo1 = Me.Combo1.ItemData(0)
right, but this is why i mentioned "first column in bound"
Post a Comment
<< Home