感谢狐爸,已经解决,能说明一下If DataTables("表A").Find(flt) Is Nothing Then 和 Dim i As Integer = Tables("表A").FindRow(flt,0,False) If i < 0 Then
这2句的意思和区别吗?老白学习中!
另外我将其用在窗口中查询时,还是出现同样的问题,当使用其他设定显示查询后,再用这个查询,还是会只显示上次查询的列,而不是全部列.
昨天晚上我将代码改成这样后,效果还一样
Dim flt As String
Dim txt As String = e.Form.Controls("xmzd").Value
If txt = "" Then
Return
End If
If IsNumeric(txt) Then
If txt.Length <> 6 Then
messagebox.show("请输入正确的位数6位数编号")
Return
Else
flt = "编号 = '" & txt & "'"
End If
Else
flt = "姓名 = '" & txt & "'"
End If
Tables("窗口1_表A").Filter = flt
Dim i As Integer = Tables("窗口1_表A").FindRow(flt,0,False)
If i < 0 Then
messagebox.show("查无此人,请重新输入正确的姓名")
End If
[此贴子已经被作者于2013-3-26 10:11:25编辑过]