此主题相关图片如下:qq截图20170622111146.png

我做了一个查询窗口
这是人员的代码,物资的代码相似
Dim cmb1 As WinForm.ComboBox = e.Form.Controls("ComboBox1")
Dim cmb2 As WinForm.ComboBox = e.Form.Controls("ComboBox2")
If e.Form.Controls("人员").Checked = True Then
cmb1.ComboList = DataTables("应急人员信息").GetComboListString("姓名")
cmb2.ComboList = DataTables("应急人员信息").GetComboListString("代号")
End If
这是搜索按钮的代码
If e.Form.Controls("人员").Checked = True
Forms("搜索结果").Show
Dim t = Forms("搜索结果").Controls("Table1").Table
t.DataSource = DataTables("应急人员信息")
Dim Filter As String = ""
With e.Form.Controls("ComboBox1")
If .Value IsNot Nothing Then
Filter = "姓名= '" & .Value & "'"
End If
End With
With e.Form.Controls("ComboBox2")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "代号= '" & .Value & "'"
End If
End With
t.Filter = Filter
ElseIf e.Form.Controls("物资").Checked = True
Forms("搜索结果").Show
Dim t = Forms("搜索结果").Controls("Table1").Table
t.DataSource = DataTables("应急资源表")
Dim Filter As String = ""
With e.Form.Controls("ComboBox1")
If .Value IsNot Nothing Then
Filter = "名称= '" & .Value & "'"
End If
End With
With e.Form.Controls("ComboBox2")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "编号= '" & .Value & "'"
End If
End With
t.Filter = Filter
End If
这是窗口的Afterload
Dim cmb1 As WinForm.ComboBox = e.Form.Controls("ComboBox1")
Dim cmb2 As WinForm.ComboBox = e.Form.Controls("ComboBox2")
If e.Form.Controls("人员").Checked = True Then
cmb1.ComboList = DataTables("应急人员信息").GetComboListString("姓名")
cmb2.ComboList = DataTables("应急人员信息").GetComboListString("代号")
ElseIf e.Form.Controls("物资").Checked = True Then
cmb1.ComboList = DataTables("应急资源表").GetComboListString("名称")
cmb2.ComboList = DataTables("应急资源表").GetComboListString("编号")
End If
但是搜索人员的时候出来的是未找到列姓名
搜索物资的时候出来的是未找到列名称
求教大神怎么回事

此主题相关图片如下:qq截图20170622111431.png


此主题相关图片如下:qq截图20170622111517.png