bunun için şöyle bir kod kullanabilirsin:
Kod:
Option Explicit
Dim ArananKelime As String
Dim KelimeninYeri, AramayaBasla As Integer
Private Sub Sorgula_Click()
ArananKelime = Me.SAdi
AramayaBasla = Forms!frm_sorgu.Form!frm_sorgu_alt_formu!İfade1.SelStart + Forms!frm_sorgu.Form!frm_sorgu_alt_formu!İfade1.SelLength
If AramayaBasla = 0 Or AramayaBasla = Len(Forms!frm_sorgu.Form!frm_sorgu_alt_formu!İfade1) Then AramayaBasla = 1
KelimeninYeri = InStr(AramayaBasla, Forms!frm_sorgu.Form!frm_sorgu_alt_formu!İfade1, ArananKelime, vbTextCompare)
If KelimeninYeri = 0 Then
MsgBox "Metin içinde böyle bir kelime yok"
Else
Forms!frm_sorgu.Form!frm_sorgu_alt_formu!İfade1.SetFocus
Forms!frm_sorgu.Form!frm_sorgu_alt_formu!İfade1.SelStart = KelimeninYeri - 1
Forms!frm_sorgu.Form!frm_sorgu_alt_formu!İfade1.SelLength = Len(ArananKelime)
End If
End Sub