以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]查询  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=102687)

--  作者:1131369760
--  发布时间:2017/6/23 20:09:00
--  [求助]查询

请问错在哪里。

这是错误提示(无法将类型为“Foxtable.WinForm.RadioButton”的对象强制转换为类型“Foxtable.WinForm.ComboBox”。

这是查询代码Dim cmb1 As WinForm.ComboBox = e.Form.Controls("radweixian")
Dim cmb2 As WinForm.ComboBox = e.Form.Controls("raddanwei")
If e.Form.Controls("radweixian").Checked = True
    Dim Filter As String = ""
    With e.Form.Controls("radweixian")
        If .Value IsNot Nothing Then
            Filter = "危险级别= \'" & .Value & "\'"
        End If
    End With
    With e.Form.Controls("Comliebie")
        If .Value IsNot Nothing Then
            If Filter > "" Then
                Filter = Filter & " And "
            End If
            Filter = Filter & "bh= \'" & .Value & "\'"
        End If
    End With
ElseIf e.Form.Controls("raddanwei").Checked = True

    Dim Filter As String = ""
    With e.Form.Controls("Comliebie")
        If .Value IsNot Nothing Then
            Filter = "wzmc= \'" & .Value & "\'"
        End If
    End With
    With e.Form.Controls("Comliebie")
        If .Value IsNot Nothing Then
            If Filter > "" Then
                Filter = Filter & " And "
            End If
            Filter = Filter & "bh= \'" & .Value & "\'"
        End If
    End With

End If


--  作者:有点蓝
--  发布时间:2017/6/23 21:00:00
--  
第一和第二行代码去掉。

要用也是这样用呀,提示这么明显咯

Dim cmb1 As WinForm.RadioButton = e.Form.Controls("radweixian")

--  作者:1131369760
--  发布时间:2017/6/23 21:44:00
--  
还是无法实现功能呀
--  作者:有点蓝
--  发布时间:2017/6/23 21:59:00
--  
你想实现什么功能啊。

最后加上

If Filter > "" Then
    Tables(
"订单").Filter = Filter
End If