Estou tentando adaptar uma rotina para buscar texto em campo memo, disponibilizado pelo Criquio... (chama-se Busca combo),,,
Mas não estou conseguindo inserir na função um evento para deletar o texto que a busca encontra...
Segue código:
Dim strSearch As String, intWhere As Integer
Dim ctlTextToSearch As control
' Get search string from user.
With Me!mmrBusca
strSearch = Me.txtBusca
' Find string in text.
intWhere = InStr(.Value, strSearch)
If intWhere Then
' If found.
.SetFocus
.SelStart = intWhere - 1
.SelLength = Len(strSearch)
Else
' Notify user.
MsgBox "String not found."
End If
End With
Gostaria de efetuar a busca normalmente, e depois do texto selecionado, fosse deletado automaticamente... como parte da rotina...
Agradeço toda ajuda!
Mas não estou conseguindo inserir na função um evento para deletar o texto que a busca encontra...
Segue código:
Dim strSearch As String, intWhere As Integer
Dim ctlTextToSearch As control
' Get search string from user.
With Me!mmrBusca
strSearch = Me.txtBusca
' Find string in text.
intWhere = InStr(.Value, strSearch)
If intWhere Then
' If found.
.SetFocus
.SelStart = intWhere - 1
.SelLength = Len(strSearch)
Else
' Notify user.
MsgBox "String not found."
End If
End With
Gostaria de efetuar a busca normalmente, e depois do texto selecionado, fosse deletado automaticamente... como parte da rotina...
Agradeço toda ajuda!