按照提示恢复到find后 如果选择开始位置 结束位置 任意位置后查找下一个的话 不会定位到对应的行
红色部分该怎么修正呢?借以实现查找的值 支持开始位置 结束位置 任意位置查找下一个
Dim cm As WinForm.ComboBox = e.Form.Controls("ComboBox1")
Dim cm2 As WinForm.ComboBox = e.Form.Controls("ComboBox2")
Dim t As WinForm.TextBox = e.Form.Controls("TextBox1")
Dim ck As WinForm.CheckBox = e.Form.Controls("CheckBox1")
Dim tb As WinForm.Table = e.Form.Controls("Table1")
Dim tj As String
With tb.Table
Dim r As Integer
If cm2.text="完全匹配" Then
tj= cm.text & "='" & t.text & "'"
If ck.Checked=True
r = .Find(t.text, .RowSel + 1,cm.text, True, True, True)
Else
r = .Find(t.text, .RowSel + 1,cm.text, False, True, True)
End If
Else If cm2.text="开始位置" Then
tj="[" & cm.text & "] Like '" & CStr(t.text) & "%'"
If ck.Checked=True
r = .Find(t.text, .RowSel + 1,cm.text, True, True, True)
‘r =.FindRow(tj)
Else
r =.FindRow(tj)
End If
Else If cm2.text="结束位置" Then
tj="[" & cm.text & "] Like '%" & CStr(t.text) & "'"
If ck.Checked=True
r =.FindRow(tj)
Else
r =.FindRow(tj)
End If
Else If cm2.text="任意位置" Then
tj="[" & cm.text & "] Like '%" & CStr(t.text) & "%'"
If ck.Checked=True
r =.FindRow(tj)
Else
r =.FindRow(tj)
End If
End If
vars("tj")=tj
If r > - 1 Then '如果找到符合条件的行
.Position = r '则选择该行
End If
End With