Dim tbx As WinForm.TextBox=e.Form.controls("chazhaokehu")
Dim mh As WinForm.CheckBox=e.Form.Controls("mohuchazhao")
Dim str As String=tbx.value
Dim dr As DataRow
If mh.Checked Then
dr=DataTables("客户资料").find("客户姓名 like '%" & str & "%'") '模糊查找
Else
dr=DataTables("客户资料").find("客户姓名= '" & str & "'") '精确查找
End If
If e.Form.Controls("chazhaokehu").text = Nothing Then
MessageBox.Show("客户姓名不为空!", "提示")
e.Form.Controls("chazhaokehu").Select
ElseIf dr IsNot Nothing Then
Dim idx As Integer=Tables("客户资料").findrow(dr)
If idx>=0 Then
Tables("客户资料").position = idx
Else
MessageBox.Show("此客户不符合筛选条件,请取消筛选后再查询!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
End If
Else
MessageBox.Show("所查找的客户不存在!", "提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
e.Form.Controls("chazhaokehu").Select
e.Form.Controls("chazhaokehu").text = Nothing
Tables("客户资料").position = 0
End If
Tables("pos机库存资料").Filter = "机具是否绑定 = False"
这样的代码有问题吗?想实现筛选出所有符合条件的数据,可执行后只是将光标一到那个到某一行上,并不是筛选出所有符合条件的数据。该怎么修改代码呢?