Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共3 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:[求助]2段筛选代码合并

1楼
185723664 发表于:2024/8/25 21:29:00
Dim t As Table = currenttable
Dim tb As String = t.cols(t.colsel).name
Dim q As WinForm.ComboBox = e.Form.Controls("ComboBox1")
Dim b As WinForm.ComboBox = e.Form.Controls("ComboBox2")
Dim s As WinForm.ComboBox = e.Form.Controls("ComboBox3")
Dim g As WinForm.ComboBox = e.Form.Controls("ComboBox4")
Dim qq As String = q.text
Dim bb As String = b.text
Dim ss As String = s.text
Dim gg As String = g.text


t.Filter = (tb & "  like '%" & qq & "%' and  " & tb & "  like '%" & bb & "%' ")
t.Filter = (tb & "  like '%" & ss & "%' and  " & tb & "  like '%" & gg & "%' ")

求助上面2段绿色代码合并,成下面黄色代码,报错如下:
从字符串“四和  like '%1%' and  四和  like '%1”到类型“Long”的转换无效。
输入字符串的格式不正确。
求助修复下面黄色代码
t.Filter = (tb & "  like '%" & qq & "%' and  " & tb & "  like '%" & bb & "%' ") Or (tb & " Like '%" & ss & "%' and  " & tb & "  like '%" & gg & "%' ")
[此贴子已经被作者于2024/8/25 21:36:46编辑过]
2楼
程兴刚 发表于:2024/8/25 21:38:00
t.Filter = "(" & tb & " like '%" & qq & "%' and " & tb & " like '%" & bb & "%' ) Or (" & tb & " Like '%" & ss & "%' and " & tb & " like '%" & gg & "%' )"
3楼
185723664 发表于:2024/8/25 21:41:00
感谢程总
共3 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .01563 s, 2 queries.