This should work for you:
"SELECT Company_Name FROM CompanyName where Company_Name Like '" &val & "%'";
You aren't very specific as to what your problem is here though, you are using a LIKE here but it sounds like a user may be able to enter multiple values in the textbox. (e.g., Company1, Company2) which then changes your SQL Query to this
"SELECT Company_Name FROM CompanyName where Company_Name IN ('" & val &"')";
Be mindful of special characters in the text box as well, if someone enters Mike's Company that is going to cause your SQL statement to fail because of the aposterphe.
Hope this helps.
-Doug
"The one language all programmers understand is profanity."
|