以文本方式查看主题
- Foxtable(狐表) (http://foxtable.com/bbs/index.asp)
-- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2)
---- 关联 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=53457)
|
-- 作者:gcc123
-- 发布时间:2014/7/8 14:28:00
-- 关联
父表按时间段筛选后子表能不能也同时出现在相同时间段内的所有关联
|
-- 作者:Bin
-- 发布时间:2014/7/8 14:31:00
--
不懂你的意思
|
-- 作者:gcc123
-- 发布时间:2014/7/8 15:10:00
--
此主题相关图片如下:qq截图20140708151000.png

我的意思是,上边的父表是按时间段和条件进行筛选的,我希望下边的子表中的时间段也是和父表一样。
|
-- 作者:有点甜
-- 发布时间:2014/7/8 15:15:00
--
这样就比较麻烦了。
你在查询按钮那里加入这段代码
Dim d1 As Date = e.Form.Controls("日期1").Value Dim d2 As Date = e.Form.Controls("日期2").Value DataTables("子表").LoadFilter = "日期 >= #" & d1 & "# and 日期 <= #" & d2 & "#" DataTables("子表").Load
|
-- 作者:gcc123
-- 发布时间:2014/7/8 15:27:00
--
稍稍改动一下,可以了 ,谢谢老师
|
-- 作者:gcc123
-- 发布时间:2014/7/8 18:27:00
--
此主题相关图片如下:qq截图20140708182600.png

只按照一个条件查询 下方的两个子表关联内容怎么都不显示呢?代码如下
Dim cy As WinForm.ComboBox = e.Form.Controls("承运")
Tables("应付查询").Filter = "承运单位 = \'" & cy.Text & "\'"
Dim Filter As String With e.Form.Controls("承运") If .Value IsNot Nothing Then Filter = "承运单位 = \'" & .Value & "\'" End If End With With e.Form.Controls("起始时间") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "日期 >= #" & .Value & "#" End If End With With e.Form.Controls("结束时间") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "日期 <= #" & .Value & "#" End If End With If Filter > "" Then Tables("应付查询").Filter = Filter End If Dim d1 As Date = e.Form.Controls("起始时间").Value Dim d2 As Date = e.Form.Controls("结束时间").Value Tables("应付查询.扣款录入").Filter = "日期 >= #" & d1 & "# and 日期 <= #" & d2 & "#" Tables("应付查询.应收查询").Filter = "日期 >= #" & d1 & "# and 日期 <= #" & d2 & "#"
|
-- 作者:狐狸爸爸
-- 发布时间:2014/7/8 18:41:00
--
你做个例子发上来看看。
|
-- 作者:有点甜
-- 发布时间:2014/7/8 19:03:00
--
代码
Dim cy As WinForm.ComboBox = e.Form.Controls("承运")
Tables("应付查询").Filter = "承运单位 = \'" & cy.Text & "\'"
Dim Filter As String Dim filter2 As String = "1=1" With e.Form.Controls("承运") If .Value IsNot Nothing Then Filter = "承运单位 = \'" & .Value & "\'" End If End With With e.Form.Controls("起始时间") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "日期 >= #" & .Value & "#" filter2 &= " and " & "日期 >= #" & .Value & "#" End If End With With e.Form.Controls("结束时间") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "日期 <= #" & .Value & "#" filter2 &= " and " & "日期 <= #" & .Value & "#" End If End With If Filter > "" Then Tables("应付查询").Filter = Filter End If
Tables("应付查询.扣款录入").Filter = filter2 Tables("应付查询.应收查询").Filter = filter2
|
-- 作者:gcc123
-- 发布时间:2014/7/8 19:16:00
--
只输入一个筛选条件后,两个子表关联列没有显示,输入时间筛选后就会出现。
|
-- 作者:有点甜
-- 发布时间:2014/7/8 19:18:00
--
看8楼,改一下来用。
|