”查询“按钮命令如下(意图为当”机房名称“和”光缆名称“中如果没有录入内容、点击"查询"后提示”请输入查询条件“;如果有输入内容则按所输入的内容进行查询);但是当”机房名称“和”光缆名称“中没有录入内容时、点击"查询"后提示”请输入查询条件“后同时弹出一个系统的提示窗口、然后整个系统的所有按钮都失效了。
Dim l1 As WinForm.ComboBox = e.Form.Controls("机房名称")
Dim l2 As WinForm.ComboBox = e.Form.Controls("光缆名称")
If l1.text="" OrElse l2.text="" Then
e.Cancel = True
messagebox.show("请输入查询条件!")
Else
End If
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
此主题相关图片如下:360截图20140208120731640.jpg