Foxtable(狐表)用户栏目专家坐堂 → 如何通过子表要素,查询主表


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

主题:如何通过子表要素,查询主表

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/10/19 21:35:00 [显示全部帖子]

Dim ddh As WinForm.TextBox = e.Form.Controls("订单号")
Dim cj As WinForm.ComboBox = e.Form.Controls("订单查询厂家筛选")
Dim dj As WinForm.TextBox = e.Form.Controls("单价")
Dim gg As WinForm.TextBox = e.Form.Controls("规格")

Dim filter As String = "1=1"
Dim filter2 As String = "1=1"
If cj.Value <> "厂家筛选" Then
    If cj.Value <> "所有客户" Then
        filter &= " and 订单客户 = '" & cj.Value & "'"
    End If
   
    If ddh.Value > "" Then
        filter &= " and 客户订单号 like '%" & ddh.Value & "%'"
    End If
   
    If dj.Value > "" Then
        filter2 &= " and 单价 = " & dj.Value & ""
    End If
   
    If gg.Value > "" Then
        filter2 &= " and 型号规格 like '%" & gg.Value.Replace("*", "[*]") & "%'"
    End If
    Dim ddhs As String = "'" & DataTables("订单明细表").GetComboListString("客户订单号", filter2).Replace("|", "','") & "'"
    Tables("查询窗体_订单主表").Filter = filter & " and 客户订单号 in (" & ddhs & ")"
Else
    MessageBox.Show("未选择厂家!")
    cj.OpenDropDown
End If


 回到顶部