以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  查找按键代码  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=61508)

--  作者:120785713
--  发布时间:2014/12/13 19:28:00
--  查找按键代码

窗口1中   有订单Tables("销售主表")      编辑框1  是查询的开始日期     编辑框2  是查询的结束日期      编辑框3   是客户      

想实现的功能是    单击查询按键后   当前窗口只显示符合条件的行 


--  作者:czy
--  发布时间:2014/12/13 19:51:00
--  
Dim name As String = e.Form.Controls("ComboBox1").value
If name = ""
    MessageBox.Show("客户名称不能为空")
    Return
End If
Dim d As Date = e.Form.Controls("DateTimePicker1").value
Dim d1 As Date = e.Form.Controls("DateTimePicker2").value
If d = Nothing
    MessageBox.Show("开始日期不能为空")
    Return
End If
If d1 = Nothing
    MessageBox.Show("结束日期不能为空")
    Return
End If
Tables("销售主表").Filter = "客户 = \'" & name & "\' and 日期 > = #" & d & "# and 日期 <= #" & d1 & "#"
--  作者:120785713
--  发布时间:2014/12/14 9:33:00
--  
以下是引用czy在2014-12-13 19:51:00的发言:
Dim name As String = e.Form.Controls("ComboBox1").value
If name = ""
    MessageBox.Show("客户名称不能为空")
    Return
End If
Dim d As Date = e.Form.Controls("DateTimePicker1").value
Dim d1 As Date = e.Form.Controls("DateTimePicker2").value
If d = Nothing
    MessageBox.Show("开始日期不能为空")
    Return
End If
If d1 = Nothing
    MessageBox.Show("结束日期不能为空")
    Return
End If
Tables("销售主表").Filter = "客户 = \'" & name & "\' and 日期 > = #" & d & "# and 日期 <= #" & d1 & "#"
谢谢了   不过这样查询不太方便    平时查询时只输入需要的条件   其他的肯定是空的  应该怎么搞呢   我照您的改出来好长啊


--  作者:有点甜
--  发布时间:2014/12/14 10:44:00
--  

 参考

 

http://www.foxtable.com/help/topics/1058.htm