测试了一下,你将查询按钮的代码改成这样
Dim l1 As WinForm.ComboBox = e.Form.Controls("机房名称")
Dim l2 As WinForm.ComboBox = e.Form.Controls("光缆名称")
Dim s As String
Dim ss1() As String = {l1.Value,l2.Value}
Dim ss2() As String = {l1.Name,l2.Name}
For i As Integer = 0 To ss1.Length-1
If ss1(i) > ""
s += " and " & ss2(i) & "='" & ss1(i) & "'"
End If
Next
SystemReady = False
Tables("光缆台帐表").Filter = s.TrimStart(" ","a","n","d")
SystemReady = True