Can't scroll combo list

  • Thread starter Thread starter Mark A. Sam
  • Start date Start date
M

Mark A. Sam

Hello,

I wrote this to filter a combo list. It is in the change event of the combo.

Private Sub TripStartLoc_Change()

If Len([TripStartLoc].Text) <= 15 And IsNull([TripStartLoc]) Then
[TripStartLoc].RowSource = "SELECT CITY, STATE FROM Cities WHERE (CITY
LIKE '" & [TripStartLoc].Text & "*') ORDER BY CITY,State"
[TripStartLoc].Dropdown
End If

End Sub

If I open the DB in A2002, I am able to scroll up and down down the list
using the arrow keys. With A2007 I can't scroll the list. Any ideas?

Thanks and God Bless,

Mark A. Sam
 
It could be a timing problem. Changing the rowsource for a combobox at the
moment when it is not stable may cause a problem.

If you keep your expression constant, i.e. not change it during the combobox
event, I guess the combo would work OK?

Try to do the update of the combobox rowsource from som other event on
another control like a button or another combo or form load event or
whatever. After update of the rowsource you should do me.comboboxname.requery
(me.tripStartLoc.requery).

Regards

Tore
 
Tore,

The procedure is ok, it is Access2007 or database corruption or both. It
worked fine in A2002. The combo has all the cities in the US, but it works
quick enough without the procedure so I omitted it and things are fine.

Thanks for the response and God Bless,

Mark
 
Back
Top