G
Guest
I have a very simple master form wrapped around a subform. I have a text
field on the main form, As the user enters text here I want this to
progressively filter the subform records on a "contains" basis.
To do this I have the text field (named "UserFilter") linked to a change
handler event roughly like-
Private Sub UserFilter_Change()
Dim BaseFilter As String
Dim UserFilter As String
BaseFilter = "OrgType.OrgTypeAbbrev='SHA'"
UF = UserFilter.Text
If (UF = "") Then
Filter = BaseFilter
Else
Filter = BaseFilter & " AND Org.Name LIKE '*" & UF & "*'"
End If
End Sub
Problem:
Getting the text value from the textbox seems the leave the text selected.
This means the next character typed replaces the first one. I have a
one-character only filter!
I have tried various hacks to do with setting the selection length to zero,
but they tend to have other nasty side effects for the user. Sureley there's
a simple way to read the changing value from a text field without screwing up
the user's interaction with that field?
field on the main form, As the user enters text here I want this to
progressively filter the subform records on a "contains" basis.
To do this I have the text field (named "UserFilter") linked to a change
handler event roughly like-
Private Sub UserFilter_Change()
Dim BaseFilter As String
Dim UserFilter As String
BaseFilter = "OrgType.OrgTypeAbbrev='SHA'"
UF = UserFilter.Text
If (UF = "") Then
Filter = BaseFilter
Else
Filter = BaseFilter & " AND Org.Name LIKE '*" & UF & "*'"
End If
End Sub
Problem:
Getting the text value from the textbox seems the leave the text selected.
This means the next character typed replaces the first one. I have a
one-character only filter!
I have tried various hacks to do with setting the selection length to zero,
but they tend to have other nasty side effects for the user. Sureley there's
a simple way to read the changing value from a text field without screwing up
the user's interaction with that field?