Hello everyone.
I have a form with textbox and a subform. The textbox filters the subform through this code:
So let's say I have these records:
Valle Grande del Canyon
Bella Vista
Viento del Norte
If I want to reach "Bella Vista", and I type "vi" in my filter, it will return "Bella Vista" and "Viento del Norte", but I'd like to be able to keep writing like this "vi b" and make it return "Bella Vista", in fact, I'd like to make it return it even if I type something like "ist ell". Or if I want it to return "Valle Grande del Canyon", type something like "yon va gra". In a way, make the filter respect the order of letters in every word, but ignore the order of words. Do I split the text? and how do I use it in the sql query? how do you deal with this? does it make sense?
I have a form with textbox and a subform. The textbox filters the subform through this code:
Code:
Option Compare Database
Option Explicit
Private Sub txtSearch_Change()
Dim rs As String
rs = _
"SELECT mm.MunicipioID, mm.Municipio " & _
"FROM tbMexicoMunicipalities AS mm " & _
"WHERE (((mm.Municipio) like '*" & Me.txtSearch.Text & "*'))" & _
"ORDER BY mm.MunicipioID ASC;"
Me.Subform_tbMexicoMunicipalities.Form.RecordSource = rs
End Sub
So let's say I have these records:
Valle Grande del Canyon
Bella Vista
Viento del Norte
If I want to reach "Bella Vista", and I type "vi" in my filter, it will return "Bella Vista" and "Viento del Norte", but I'd like to be able to keep writing like this "vi b" and make it return "Bella Vista", in fact, I'd like to make it return it even if I type something like "ist ell". Or if I want it to return "Valle Grande del Canyon", type something like "yon va gra". In a way, make the filter respect the order of letters in every word, but ignore the order of words. Do I split the text? and how do I use it in the sql query? how do you deal with this? does it make sense?