Dim txt As String = e.Form.Controls("TextBox1").Text
Dim dr As DataRow
Dim po As Integer
dr = DataTables("溯源码").SQLFind("子溯源码 ='" & txt & "'" )
If dr Is Nothing Then
MessageBox.Show("此子溯源码不存在!")
Else
DataTables("溯源码").LoadFilter = "子溯源码 = '" & txt & "'"
DataTables("溯源码").Load()
po = Tables("溯源码").FindRow(dr)'找出该DataRow在Table中的位置
If po >= 0 Then '如果找到
Tables("溯源码").Position = po '选定
End If
End If
我想把上面代码修改为: 不比较“子溯源码”最后一位,与txt的值相同; 如“子溯源码” 为123456,只需12345=“txt”