Hi!
I want to use TextBox to populate data in the ListBox as user types data in the TextBox.
I made SQL to use as RowSource for the ListBox and it works fine if I use CommandButton to triger the event. Since I want as-you-type event, I tried to use On Key Up or On Change properties, in TextBox, to triger the event. It is not working.
Can you please help?
Code:
Dim st as String
st = "SELECT ID.db, CompanyName.db "
st = st & "FROM db WHERE (((DB.[CompanyName]) Like '*'&[TextBox]&'*'));"
ListBox.RowSource = st
---- above is not the actual code, but you will get the point and it works if I trigger the event by CommandButton----
I even tried to use:
ListBox.Requery
I want to use TextBox to populate data in the ListBox as user types data in the TextBox.
I made SQL to use as RowSource for the ListBox and it works fine if I use CommandButton to triger the event. Since I want as-you-type event, I tried to use On Key Up or On Change properties, in TextBox, to triger the event. It is not working.
Can you please help?
Code:
Dim st as String
st = "SELECT ID.db, CompanyName.db "
st = st & "FROM db WHERE (((DB.[CompanyName]) Like '*'&[TextBox]&'*'));"
ListBox.RowSource = st
---- above is not the actual code, but you will get the point and it works if I trigger the event by CommandButton----
I even tried to use:
ListBox.Requery