
Data Control recordsource problem
I am using VB4/16 against MS Sql Server 4.21a. I have a data control whose
recordsource property is not set until the user enters part of a name in a text
box. The lose focus event of the text box then sets the data1.recordsource =
"Select * from mytable where thename like '*" & txtbox & "*'"
My problem is that sometimes it doesn't work. For example, if I type White
into the text box and hit tab, the lose focus code runs and returns an empty
recordset. When I type White into the text box again and hit tab, the lose
focus code runs and returns a two record recordset, which is correct. However,
other strings usually work. Also, if a search has succeeded, White will return
the two record recordset the first time.
Any ideas?
TIA
Colleen