J
JohnM77 via AccessMonster.com
This is probably slapping me in the face, but I can't seem to figure out an
easy way to simply programmatically select the first item in a combobox
dropdown list. I have comboboxes populated with recordsets, of which the
first column is ID number. I use ADO to perform a query identical to the
combobox.rowsource property and then set Combobox.Value =
rsIdenticalRecordset!IDNumber. It works, but there has to be an easier way.
Something like the VB6 method of combobox.ListIndex = 0 seems reasonable. I
found the following technique,
Forms([form name]).Controls([combobox name]).SetFocus
Forms([form name]).Controls([combobox name]).ListIndex = 0
but requiring the control to have focus causes lots of problems. Are there
any alternatives to the two methods I mentioned?
Thanks,
John
easy way to simply programmatically select the first item in a combobox
dropdown list. I have comboboxes populated with recordsets, of which the
first column is ID number. I use ADO to perform a query identical to the
combobox.rowsource property and then set Combobox.Value =
rsIdenticalRecordset!IDNumber. It works, but there has to be an easier way.
Something like the VB6 method of combobox.ListIndex = 0 seems reasonable. I
found the following technique,
Forms([form name]).Controls([combobox name]).SetFocus
Forms([form name]).Controls([combobox name]).ListIndex = 0
but requiring the control to have focus causes lots of problems. Are there
any alternatives to the two methods I mentioned?
Thanks,
John