'查找 TextBox 控件中指定的文本。
FoundPos = rs.Find(DataGrid1.Text, , , rtfWholeWord) '根据是否找到文本,显示相应的消息。 If FoundPos <> -1 Then
'返回已找到文本所在行的行号。
FoundLine = DataGrid1.GetLineFromChar(FoundPos)
MsgBox "Word found on line " & CStr(FoundLine)
Else
MsgBox "Word not found."
End If
If rs.RecordCount <> 0 Then
Set DataGrid1.DataSource = rs
DataGrid1.Refresh
End If
FoundPos = rs.Find(DataGrid1.Text, , , rtfWholeWord) '根据是否找到文本,显示相应的消息。 If FoundPos <> -1 Then
'返回已找到文本所在行的行号。
FoundLine = DataGrid1.GetLineFromChar(FoundPos)
MsgBox "Word found on line " & CStr(FoundLine)
Else
MsgBox "Word not found."
End If
If rs.RecordCount <> 0 Then
Set DataGrid1.DataSource = rs
DataGrid1.Refresh
End If
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货