Hi Experts,
MS Access 2007, running on Win 2003 Server.
We have a listbox on a form for selecting records to display in that form - it contains a list of customer names. I know that hitting the first letter in the listbox will take me to the first record in the list starting with that letter but the list is getting quite long - is there a way that a user could input the first 3 characters into a text box, then for the listbox to go the first record matching (or near matching) those 3 characters?
Example:
User enters "sma" in text box, listbox contains "small" and "smart", so presented record would be "small"
User enters "smo" but there is no exact match, so record returned should be either previous or next best match
Any thoughts gratefully received.
private sub text0_change()
dim str as string, sql
str=str & me.text0.text
sql="select f1,f2 from table where f1 like '" & str & "*'"
me.listbox.rowsource=sql
end sub