This is a continuation of a previous question (
http://bit.ly/2yRemJp).
I have a textbox (key_sel) on a form (switchboard) that I want to allow the user to enter in a series of values separated by a semicolon, which will then be used as criteria in a query.
SQL statement is below:
keysql = "SELECT dbo_sys1_key_codes.key_cod
e FROM dbo_sys1_key_codes Where key_code LIKE ('" & Replace(Trim(Forms!Switchb
oard!key_s
el), ";", "' or '") & "')"
If I use one value (*2XH07) the query runs fine and pulls the correct data. When I specify multiple criteria (I used *2XH07;*9XH16 as the value) it pulls no data. When I design view the query the query the criteria is below. Obviously the first "Like " is creating the problem.
Like (Like '*2XH07' Or Like '*9XH16')
Don't know what I'm doing wrong.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Expert of the Year award recognizes an expert who helped improve Experts Exchange in the past year through high levels of contributions and participation on site. This award is given to the expert who has achieved the highest levels of participation, while maintaining quality contributions and professionalism.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.