Foxtable(狐表)用户栏目专家坐堂 → 还是filter


  共有3310人关注过本帖平板打印复制链接

主题:还是filter

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


加好友 发短信
等级:小狐 帖子:355 积分:3931 威望:0 精华:0 注册:2014/7/29 23:42:00
还是filter  发帖心情 Post By:2015/1/23 0:58:00 [只看该作者]

还是那三个text,一个完全匹配,两个模糊匹配,从两个表中查,帮忙再看看吧。
两个表筛出来,结果总是一行。每个text筛出至少一条数据的话,按说应该至少三行才对。但结果总是后面的覆盖前面的,最后显示一条数据。


Dim Filter1 As String
Dim Filter2 As String
Dim Filter3 As String
Dim Filter As String
Dim txt1 As String = e.Form.Controls("TextBox7").Text
Dim txt2 As String = e.Form.Controls("TextBox8").Text
Dim txt3 As String = e.Form.Controls("TextBox9").Text



txt1 = "'" & txt1 & "'"
Filter1 = "编号 = " & txt1

txt2 = "'%" & txt2 & "%'"
txt3 = "'%" & txt3 & "%'"
Filter2 = "公司名称 Like " & txt2
Filter3 = "产品名称 Like " & txt3

If txt1 <> "''" And txt2 <>"'%%'" And txt3 <>"'%%'" Then
   filter = filter1 & " or " & filter2 & " or " & filter3
 
End If

If txt1 = "''" And txt2 <>"'%%'" And txt3 <>"'%%'" Then
   filter = filter2 & " or " & filter3

End If

If txt1 = "''" And txt2 ="'%%'" And txt3 <>"'%%'" Then
   filter = filter3

End If

If txt1 <> "''" And txt2 ="'%%'" And txt3 <>"'%%'" Then
   filter = filter1 & " or " & filter3

End If

If txt1 <> "''" And txt2 ="'%%'" And txt3 ="'%%'" Then
   filter = filter1

End If

If txt1 = "''" And txt2 <>"'%%'" And txt3 ="'%%'" Then
   filter = filter2

End If

If txt1 = "''" And txt2 ="'%%'" And txt3 ="'%%'" Then
   messagebox.show("请填写要搜索的内容","提示")

End If

If txt1 <> "''" And txt2 <>"'%%'" And txt3 ="'%%'" Then
   filter = filter1 & " or " & filter2

End If

Dim dr1 As DataRow
With DataTables("ChemSign1")    
    
         .LoadFilter = Filter
    .Load
    dr1 = .Find(Filter)

End With

Dim dr2 As DataRow
With DataTables("ChemSign2")    
    
         .LoadFilter = Filter
    .Load
    dr2 = .Find(Filter)

End With


 回到顶部
总数 26 1 2 3 下一页