Dim nms() As String = {"年级","班级","学号","姓名"} '定义一个组合框数组
Dim sps() As String = {"'","'","'","'"} '定义一个间隔符数组
Dim bjf() As String = {" = "," = "," = "," = "} '定义一个比较符合数组
Dim fds() As String = {"年级","班级","学号","姓名"} '定义比较的列
Dim filter As String
For i As Integer = 0 To nms.length -1
If e.Form.controls(nms(i)).value IsNot Nothing Then
If filter > "" Then
filter = filter & " And "
End If
filter = filter & fds(i) & bjf(i) & sps(i) & e.Form.controls(nms(i)).value & sps(i)
End If
Next
Tables("导入学生_学生信息表").datatable.loadfilter = filter
Tables("导入学生_学生信息表").datatable.load