I’m trying to do a autocomplete combobox like this in the keyUp event.
Private Sub Combo59_KeyUp(KeyCode As Integer, Shift As Integer)
If Len(Combo59.Text) > 2 Then
Combo59.RowSource = "SELECT City FROM Mills WHERE City LIKE '%" & Combo59.Text & "%' GROUP BY City ORDER BY City;"
Me.Dirty = False
Combo59.Requery
End If
End Sub
The problem is that after the requery, it selects all the text in the field so when the user press the next key, it erases everything.
Is there an easy way, or I have to find the cursor position and put it back after the requery?
Thank you
This may require some tweaking, but it should give you the general idea: