combobox show first item in combo's text box

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

Guest

Hello,

I'm using VBA to update the recordSource of a combo box. That works fine,
but the combo box does not show anything until I click on the pull-down. I
would like the first item in the source to be the default value in the combo
box, so that the person does not have to click the combo box unless they want
to change the default value.

I can't post my code currently because I'm on another computer, but if that
is needed I can post the code when my computer is running again.

NOTES:
I can use cboContract_number.dropdown to automatically display the values
in the list, but even that does not fill in the text_box of the
cboContract_number until I click on something in the dropdown list.

thank you,

phill
 
To select the 1st item in a combobox (or listbox) programatically:

cboFieldx = cboFieldx.ItemData(0)

This line is the equivalent of clicking the 1st item and would need to be
placed appropriately. AFAIK, there is no way to automatically set a combo
box control to default to the 1st item. You have to set it yourself.
--

HTH,
George Nicholson

Remove 'Junk' from return address.
 
Back
Top