Rss & SiteMap

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

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

标题:求模糊筛选代码

1楼
老有所乐 发表于:2009/3/14 22:55:00
在窗口的文本框中输入要找到关键字,如输入“西”,点击“模糊筛选”按钮,就能筛选出第4行(第二列),6行(第三列),7行(备注)包含有“西”字的行.
求“模糊筛选”按钮代码
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目7.table

2楼
狐狸爸爸 发表于:2009/3/14 23:08:00
Dim Filter As String = ""
Dim Val As String = "西"
For each c As col In CurrentTable.Cols
    If c.IsString Then
       If Filter > "" Then
            Filter = Filter & " Or "
        End If
        Filter = Filter &  c.Name & " Like '*" & Val & "*'"
   End If
Next
CurrentTable.Filter = Filter
3楼
舜风 发表于:2009/3/14 23:23:00
第一、定义全局变量 “搜索”

第二、按键设置代码如下:
Dim str As String = e.Form.Controls("TextBox42").Value
If str is nothing Then
    MsgBox("提示: 空值等于筛选全部! ",64,"提示")
end if
    Tables("表一").Filter = "[列名1] Like '*" & Vars("搜索") & "*' Or [列名2] Like '*" & Vars("搜索") & "*'"
4楼
程兴刚 发表于:2009/3/14 23:55:00
Dim Filter As String = ""
Dim Val As String = Forms("窗口1").Controls("TextBox1").Value
if Val is nothing then
   MessageBox.Show("对不起,请先输入查找内容!", "提示")
Else
   For each c As col In CurrentTable.Cols
      If c.IsString Then
         If Filter > "" Then
            Filter = Filter & " Or "
         End If
         Filter = Filter &  c.Name & " Like '*" & Val & "*'"
      End If
   Next
   CurrentTable.Filter = Filter
end if
5楼
老有所乐 发表于:2009/3/15 7:19:00
谢谢贺老师,程老师,谢谢舜风先生!
共5 条记录, 每页显示 10 条, 页签: [1]

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

Powered By Dvbbs Version 8.3.0
Processed in .03125 s, 3 queries.