Foxtable(狐表)用户栏目专家坐堂 → [求助]查询窗口问题(代码哪里有问题)?


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

主题:[求助]查询窗口问题(代码哪里有问题)?

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/1/31 9:41:00 [显示全部帖子]

Dim zb As WinForm.ComboBox = e.Form.Controls("组别")
Dim cddh As WinForm.TextBox = e.Form.Controls("出单单号")
Dim jddh As WinForm.TextBox = e.Form.Controls("进单单号")
Dim bz As WinForm.TextBox = e.Form.Controls("备注")
Dim StartDate As WinForm.DateTimePicker = e.Form.Controls("开始时间")
Dim Filter   As   String
With e.Form.Controls("出单单号")
    If .Value   IsNot   Nothing  Then
        Filter =   "出单单号 like '%" & cddh.Value &   "%'"
    End   If
End   With
With e.Form.Controls("备注")
    If .Value   IsNot   Nothing   Then
        If Filter > ""   Then
            Filter = Filter &   " And "
        End   If
        Filter = Filter &   "备注 like '%" & bz.Value &   "%'"
    End   If
End   With
With e.Form.Controls("组别")
    If .Value   IsNot   Nothing   Then
        If Filter > ""   Then
            Filter = Filter &   " And "
        End   If
        Filter = Filter &   "组别 like '%" & zb.Value &   "%'"
    End   If
   
End   With
With e.Form.Controls("进单单号")
    If .Value   IsNot   Nothing   Then
        If Filter >""   Then
            Filter = Filter &   " And "
        End   If
        Filter = Filter &   "进单单号 like '%" & jddh.Value &   "%'"
    End   If
End   With
 With e.Form.Controls("开时时间")
       If .Value   IsNot   Nothing   Then
           If Filter >""   Then
             Filter = Filter &   " And "
           End   If
         Filter = Filter &   "要求出单时间 = #" & StartDate .Value &   "#"
       End   If
 End   With
If   Filter >   "" Then
    Tables("进出单表").Filter =   Filter
End If

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/1/31 10:58:00 [显示全部帖子]

Filter = Filter &   "要求出单时间 >= #" & StartDate .Value &   "# And 要求出单时间 < #" & StartDate .Value.AddDays(1) & "#"

 回到顶部