-- 作者:feixianzhi
-- 发布时间:2017/2/8 8:11:00
-- 窗口用拼音首字母查询问题
此主题相关图片如下:qq截图20170208080509.png
Dim txt As String = e.Form.Controls("spmc").Text Dim tbl1 As Table = Tables("综合查询_Table入库表1") Dim tbl2 As Table = Tables("综合查询_Table入库表2") Dim tbl3 As Table = Tables("综合查询_Table批发表1") Dim tbl4 As Table = Tables("综合查询_Table批发表2") Dim tbl5 As Table = Tables("综合查询_Table返利合同") Dim tbl7 As Table = Tables("综合查询_Table商品信息") Dim tbl8 As Table = Tables("综合查询_Table新标目录") Dim tbl9 As Table = Tables("综合查询_Table收缴表")
If txt = "" Then tbl1.Filter = "" tbl2.Filter = "" tbl3.Filter = "" tbl4.Filter = "" tbl5.Filter = "" tbl7.Filter = "" tbl8.Filter = "" tbl9.Filter = "" Else txt = "\'%" & txt & "%\'" tbl1.Filter = "商品名称 Like " & txt tbl2.Filter = "商品名称 Like " & txt tbl3.Filter = "商品名称 Like " & txt tbl4.Filter = "商品名称 Like " & txt tbl5.Filter = "商品名称 Like " & txt tbl7.Filter = "商品名称 Like " & txt tbl8.Filter = "通用名 Like " & txt tbl9.Filter = "商品名称 Like " & txt End If
以上代码是查询商品名称时的代码,但必须输入商品名称的汉字。我想实现,输入商品名称的拼音首字母就能查询,如:查询“复方伤痛胶囊”,则只需输入:“ffstjn“就可以,代码怎么改,请各位老师帮忙。
|