P
plh
Hello Everyone:
The following code works very well except that the user has to keep clicking the
end of the string in the text box in order to add to it.
What I am really after is that after each entry into the text box, the list
(it's a continuous forms type of view) is progressively narrowed down. I seem to
recall that there is a simple way to make the cursor position itself at the end
of the string, but I'll be damned if I can find it in the MS help at this point!
Private Sub txtFilter_Change()
Dim strSQL As String
Debug.Print Me.txtFilter.Value
strSQL = "SELECT * FROM tblCustOrds WHERE COP LIKE '" & Me.txtFilter.Value &
"*'"
Me.RecordSource = strSQL
Me.txtFilter.SetFocus
End Sub
I also can't help but notice that on the first "shot", Debug.Print
Me.txtFilter.Value shows up "" and so there is no filtering effect until the
second shot. It may be relevant that I also have an after update event:
Private Sub txtFilter_AfterUpdate()
Call txtFilter_Change
End Sub
Any help will be greatly appreciated!
-plh
The following code works very well except that the user has to keep clicking the
end of the string in the text box in order to add to it.
What I am really after is that after each entry into the text box, the list
(it's a continuous forms type of view) is progressively narrowed down. I seem to
recall that there is a simple way to make the cursor position itself at the end
of the string, but I'll be damned if I can find it in the MS help at this point!
Private Sub txtFilter_Change()
Dim strSQL As String
Debug.Print Me.txtFilter.Value
strSQL = "SELECT * FROM tblCustOrds WHERE COP LIKE '" & Me.txtFilter.Value &
"*'"
Me.RecordSource = strSQL
Me.txtFilter.SetFocus
End Sub
I also can't help but notice that on the first "shot", Debug.Print
Me.txtFilter.Value shows up "" and so there is no filtering effect until the
second shot. It may be relevant that I also have an after update event:
Private Sub txtFilter_AfterUpdate()
Call txtFilter_Change
End Sub
Any help will be greatly appreciated!
-plh