Foxtable(狐表)用户栏目专家坐堂 → [求助]简化代码


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

主题:[求助]简化代码

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


加好友 发短信
等级:版主 帖子:1693 积分:12135 威望:0 精华:7 注册:2013/7/11 10:52:00
  发帖心情 Post By:2015/8/1 13:45:00 [显示全部帖子]

Dim filter As String  = ""
If e.Form.Controls("ComboBox1").text > ""  Then  filter = "仓库 = '" & e.Form.Controls("ComboBox1").text & "' "
If e.Form.Controls("DateTimePicker1").text >"" Then  filter =filter & " And 日期 >= #" & e.Form.Controls("DateTimePicker1").text & "# "
If e.Form.Controls("DateTimePicker2").text >""  Then  filter =filter & " And 日期 <= #" & e.Form.Controls("DateTimePicker2").text & "#  "
If e.Form.Controls("DropBox1").text >""  Then  filter =filter & " And 品号 ='" & e.Form.Controls("DropBox1").text & "' "
filter = filter.Trim
If filter.StartsWith("And") Then  filter = filter.SubString(3)
Tables("台账查询_table1").Filter = filter

 回到顶部