Setting a combo box to an initial value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a combo box which sets a form which sets subforms on that form. The
only problem is that the combo box doesn't have a value when it initially
loads, it's blank. What sort of method should I have the onLoad event call
to have the Combo box start off with a value listed? Perhaps there's some
sort of "next" feature that would bump the combo box to the next (first)
listed value in its rowsource?
 
Banaticus said:
I have a combo box which sets a form which sets subforms on that form. The
only problem is that the combo box doesn't have a value when it initially
loads, it's blank. What sort of method should I have the onLoad event call
to have the Combo box start off with a value listed? Perhaps there's some
sort of "next" feature that would bump the combo box to the next (first)
listed value in its rowsource?


If it's a bound control, you probably do not want to set the
combo box's value and dirty the record. If that's not an
issue, use:

Me.combobox = Me.combobox.ItemData(0)

but, it's probably better to set then combo box's
DefaultValue property instead:

Me.comboboxDefaultValue = _
"""" & Me.combobox.ItemData(0) & """"
 
Back
Top