Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共5 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:[求助]出现下列错误,找不到原因,请专家指导,

1楼
hrw68529 发表于:2024/4/22 9:03:00
出现下述错误:

图片点击可在新窗口打开查看此主题相关图片如下:截图00.jpg
图片点击可在新窗口打开查看

2楼
hrw68529 发表于:2024/4/22 9:07:00
在窗口控件事件textchanged中运行下列代码时,出错
代码如下:Dim tian As WinForm.ComboBox = e.Form.Controls("天数")
Dim mss As WinForm.ComboBox = e.Form.Controls("面试室")
Dim wlmc As WinForm.ComboBox = e.Form.Controls("首字母")
If tian.value = Nothing Or mss.value = Nothing Then
    Tables("号对人_号对人").Filter= "首字母 like '*" & wlmc.Text & "*'"
ElseIf tian.value IsNot Nothing And mss.value = Nothing Then
Tables("号对人_号对人").Filter="天数 = '" & tian.Text & "'And 面试序号 Is null And 首字母 Like '*" & wlmc.Text & "*'"
ElseIf tian.value IsNot Nothing And mss.value IsNot Nothing Then
    Tables("号对人_号对人").Filter="天数 = '" & tian.Text & "' and 面试室 = '" & mss.Text & "'and 面试序号 is null and 首字母 like '*" & wlmc.Text & "*'"
End If
3楼
cd_tdh 发表于:2024/4/22 9:15:00
参考代码:(如果不是单独查询按钮,代码写到ValueChanged事件
Dim Filter As String
With e.Form.Controls("天数")
    If .Value <> Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter &= "天数 = '" & .Value & "'"
    End If
End With
With e.Form.Controls("面试室")
    If .Value <> Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "面试室 like '%" & .Value & "%'"
    End If
End With
With e.Form.Controls("首字母")
    If .Value <> Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "首字母 like '%" & .Value & "%'"
    End If
End With
If Filter > "" Then
    Tables("号对人_号对人").Filter = Filter
End If
[此贴子已经被作者于2024/4/22 9:16:33编辑过]
4楼
有点蓝 发表于:2024/4/22 9:22:00
Dim tian As WinForm.ComboBox = e.Form.Controls("天数")
Dim mss As WinForm.ComboBox = e.Form.Controls("面试室")
Dim wlmc As WinForm.ComboBox = e.Form.Controls("首字母")
If tian.value Is Nothing Or mss.value Is Nothing Then
    Tables("号对人_号对人").Filter = "首字母 like '*" & wlmc.Text & "*'"
ElseIf tian.value IsNot Nothing And mss.value Is Nothing Then
    Tables("号对人_号对人").Filter = "天数 = '" & tian.Text & "'And 面试序号 Is null And 首字母 Like '*" & wlmc.Text & "*'"
ElseIf tian.value IsNot Nothing And mss.value IsNot Nothing Then
……

或者
Dim tian As WinForm.ComboBox = e.Form.Controls("天数")
Dim mss As WinForm.ComboBox = e.Form.Controls("面试室")
Dim wlmc As WinForm.ComboBox = e.Form.Controls("首字母")
If tian.Text = "" Or mss.Text = "" Then
    Tables("号对人_号对人").Filter = "首字母 like '*" & wlmc.Text & "*'"
ElseIf tian.Text > "" And mss.Text = "" Then
    Tables("号对人_号对人").Filter = "天数 = '" & tian.Text & "'And 面试序号 Is null And 首字母 Like '*" & wlmc.Text & "*'"
ElseIf tian.Text > "" And mss.Text > "" Then
    Tables("号对人_号对人").Filter = "天数 = '" & tian.Text & "' and 面试室 = '" & mss.Text & "'and 面试序号 is null and 首字母 like '*" & wlmc.Text & "*'"
End If
5楼
hrw68529 发表于:2024/4/22 10:05:00
谢谢您
共5 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .08594 s, 2 queries.