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?
Alex Dybenko - 04 Feb 2006 18:24 GMT
Hi,
try:
Me.Combo1.DefaultValue = Me.Combo1.Column(0, 0)

Signature
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com
>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
[quoted text clipped - 3 lines]
> sort of "next" feature that would bump the combo box to the next (first)
> listed value in its rowsource?
Marshall Barton - 04 Feb 2006 19:39 GMT
>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) & """"

Signature
Marsh
MVP [MS Access]