以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助] 条件查询  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=127828)

--  作者:susanhe
--  发布时间:2018/11/22 20:44:00
--  [求助] 条件查询

这几天刚接触这个foxtable,请大侠们来帮忙,

 

我要做个条件查询,如表。

 

当只输入第一列内容时,就可查询表中的相关记录,先模糊查,直到输入精确,输完结查就出来,不用按键

 

当输入第二列时,在第一列的基础上找,也是先模糊查,直到输入精确,输完结查就出来,不用按键

 

当输入第十列时,在第一,二列的基础上找,也是先模糊查,直到输入精确,输完结查就出来,不用按键

 

当某列中的内容为空时,默认全部记录。

 

请各位提供一下,看看有没有好的可用。附上表。感谢。

 

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目001.table


--  作者:有点甜
--  发布时间:2018/11/22 21:14:00
--  

参考

 

http://www.foxtable.com/webhelp/scr/1058.htm

 

http://www.foxtable.com/webhelp/scr/1647.htm

 


--  作者:susanhe
--  发布时间:2018/11/22 23:09:00
--  

初识这个,大侠可不可以帮忙加到实例中,对我来说还是第一次用这个。


--  作者:有点甜
--  发布时间:2018/11/23 9:07:00
--  
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目001 (1).table


--  作者:susanhe
--  发布时间:2018/11/23 18:16:00
--  

非常棒,谢谢。再咨询一下,如果我要将第十列改成日期型,输入下拉日期框型的。能帮忙调整一下吗 ?

 

 

Dim t1 As WinForm.TextBox = e.Form.Controls("TextBox1")
Dim t2 As WinForm.TextBox = e.Form.Controls("TextBox2")
Dim t3 As WinForm.TextBox = e.Form.Controls("TextBox3")
Dim filter As String = "1=1"
If t1.text > "" Then
    filter &= " and 第一列 like \'%" & t1.text & "%\'"
End If
If t2.text > "" Then
    filter &= " and 第四列 like \'%" & t2.text & "%\'"
End If
If t3.text > "" Then
    filter &= " and 第十列 like \'%" & t3.text & "%\'"
End If
e.Form.controls("table1").Table.filter = filter


--  作者:有点蓝
--  发布时间:2018/11/23 20:05:00
--  
Dim t3 As WinForm.DateTimePicker = e.Form.Controls("DateTimePicker1")
-------------
filter &= " and 第十列 like \'%" & t3.text & "%\'"

改为

filter &= " and 第十列 = #" & t3.Value & "#"

--  作者:susanhe
--  发布时间:2018/11/23 20:24:00
--  
谢谢。
--  作者:susanhe
--  发布时间:2018/11/23 21:01:00
--  

大侠, 我把texbox1改成combobox1,出现类型不对,能帮忙修改一下吗? 谢谢。

 

Dim t1 As WinForm.TextBox = e.Form.Controls("Combobox1")
Dim t2 As WinForm.TextBox = e.Form.Controls("TextBox2")

Dim t3 As WinForm.DateTimePicker = e.Form.Controls("DateTimePicker2")

Dim filter As String = "1=1"
If t1.text > "" Then
    filter &= " and Endcustomer like \'%" & t1.text & "%\'"
End If
If t2.text > "" Then
    filter &= " and GSSpart like \'%" & t2.text & "%\'"
End If

If t3.text > "" Then

     filter &= " and ETD = #" & t3.Value & "#"
\'    filter &= " and ETD like \'%" & t3.text & "%\'"
End If
e.Form.controls("table1").Table.filter = filter


--  作者:有点蓝
--  发布时间:2018/11/23 21:09:00
--  
Dim t1 As WinForm.Combobox= e.Form.Controls("Combobox1")


--  作者:susanhe
--  发布时间:2018/11/29 7:51:00
--  
版主,再请问一下,记录查询出来了,可以查询表是不是进行编辑的,如何是查询结果中双点某个人员后出现带出该人员的基本资料进行修改。谢谢。