Me.Combo2 = Me.Combo2.ItemData(0)
Where 'Combo2' is the name of your combo box. The ItemData collection is
zero-based, so ItemData(0) is the first item in the list, ItemData(1) is the
second item, etc.

Signature
Brendan Reynolds
>I implemented a wizard that dynamically updates the sub forms when Next is
> clicked. I would like to automatically select a certain item in a combo
[quoted text clipped - 8 lines]
>
> Thanks in advance.
Ibrahim Mesbah - 18 Dec 2005 00:26 GMT
Thank you. That worked, but still having problems. I was doing this logic
in the OnLoad function, and it didn't work. I'm guessing it's because the
combo was yet to be calculated. The row source for this combo is a sql
statement. So I moved the code to the OnCurrent, and that seemed to work,
except now the focus is not at the first field. I figured, ok, i'll just set
the focus to the first field, which is a requireed one, using SetFocus after
the combo box operation, but that didn't work. When I click in the text box
manually, I get an error msg from Access saying the field cannot be null (the
first one). I click on ok, then click in the field, and it's good. I
figured I can get around this by turning the warnings off, but that didn't
help... The more I use access the more I hate it - documentation sucks too..
Thanks again
> Me.Combo2 = Me.Combo2.ItemData(0)
>
[quoted text clipped - 14 lines]
> >
> > Thanks in advance.
John B - 29 Dec 2005 04:59 GMT
If you want to trigger AfterUpdate event, add:
Me.Combo2.Requery
after Me.Combo2 = Me.Combo2.ItemData(0)
> Me.Combo2 = Me.Combo2.ItemData(0)
>
[quoted text clipped - 14 lines]
> >
> > Thanks in advance.