String search on a Memo field

manwen

New member
Local time
Today, 21:19
Joined
Aug 2, 2002
Messages
6
Hello all:

I have a form with a textbox. In this text box I would like to search text that has been typed in the box for a specific word, and if this phrase has been found, I would like specific checkboxes to be checked. A sample of my code for this is below:

Private Sub Notes_AfterUpdate()
If InStr(0, Me.Notes.Text, "contact") > 0 Then
Me.chkFollowUp = True
End If
End Sub

However, when I update the textbox I get an error on the If line.
Can anybody help me spot what is wrong with my code?:)
Thanks!
 
M,

Try changing If InStr(0, Me.Notes.Text, "contact") > 0 Then

to this: If InStr(1, Me.Notes.Value, "contact") <> 0 Then

Regards,
Tim
 
Of course! Thanks for your help, Tim!

Werlindo
 

Users who are viewing this thread

Back
Top Bottom