Foxtable(狐表)用户栏目专家坐堂 → [求助] 查询按钮公式


  共有2844人关注过本帖树形打印复制链接

主题:[求助] 查询按钮公式

帅哥哟,离线,有人找我吗?
大红袍
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/5/13 17:33:00 [显示全部帖子]

1、名称要和列一致

 

2、

 

For Each c As Col In Tables("抢修整治迁改表").Cols
    For Each ctl As WinForm.Control In e.Form.Controls
        If c.Name = ctl.Name Then
            If e.Form.Controls(ctl.Name).Text > "" Then
                If c.IsDate Then
                    flt + = " And " & c.Name & " = #" & e.Form.Controls(ctl.Name).Text & "#"
                ElseIf c.IsString Then
                    flt + = " And " & c.Name & " Like '%" & e.Form.Controls(ctl.Name).Text & "%'"
                ElseIf c.IsBoolean AndAlso e.Form.Controls(ctl.Name).Check Then
                    msgbox(c.Name)
                    flt + = " And " & c.Name & " = " & e.Form.Controls(ctl.Name).Checked
                End If

            End If
        End If
    Next
Next


 回到顶部