Access开发培训
网站公告
·Access专家课堂QQ群号:151711184    ·Access快速开发平台下载地址及教程    ·欢迎加入Access专家课堂微信群!    ·如何快速搜索本站文章|示例|资料    
您的位置: 首页 > 技术文章 > 源码示例

遍历窗体全字段模糊查询

时 间:2013-07-01 10:38:58
作 者:一杯绿茶   ID:36  城市:遂宁
摘 要:根据网有要求,由于子窗体字段较多,所以通过遍历子窗体所有控件,然后进行模糊查询。
正 文:

根据网有要求,由于子窗体字段较多,所以通过遍历子窗体所有控件,然后进行模糊查询。下载附件

 Dim strWhere As String
    Dim ctl As Control
    Dim ctlname As String
    strWhere = Trim$(Me.Text4.Text)
    For Each ctl In Me.物资库存_子窗体.Form.Controls
        If TypeOf ctl Is TextBox Then
            ctlname = ctlname & "[" & ctl.Name & "] & "

         End If
    Next
    ctlname = Left(ctlname, Len(ctlname) - 3)
      strWhere = "" & ctlname & "  like  '*" & strWhere & "*'"
      Me.物资库存_子窗体.Form.Filter = strWhere
    '应用筛选
    Me.物资库存_子窗体.Form.FilterOn = True




Access软件网QQ交流群 (群号:483923997)       Access源码网店

常见问答:

技术分类:

相关资源:

专栏作家

关于我们 | 服务条款 | 在线投稿 | 友情链接 | 网站统计 | 网站帮助