窗口中有一个文本框 TextBoxcxnr ,以下代码写在该控件的TextChanged事件中。
Dim txt_Name As String = e.form.Controls("TextBoxcxnr").Text
Dim py_txt_Name As String = getpy(txt_Name,True)
Tables("Test_Table1").Fill( " S elect [物料名称],[规格],[颜色] From {入库明细} where 物料名称 = '" & txt_Name & "'" , True)
If Tables("Test_Table1").Current Is Nothing Then
Tables("Test_Table1").Fill( " S elect [物料名称],[规格],[颜色] From {入库明细} where 物料名称拼音 like '%" & py_txt_Name & "%'" , True)
End If
当在文本框中输入内容时,报错:“select 语句执行错误,请检查语法及数据源设置”
但是,把 if ...... End if (浅红色部分)这段代码注释掉后,执行不会报错。本意是 这段代码是执行拼音首字母模糊查询的
请问这段代码报错,是什么地方有问题! 而且“入库明细”表中是存在 “物料名称拼音”列。
求解!!(请版主原谅,不得不重发,很急,求解!我是新手)