Tom,
In the database Window, goto Forms. Select the form where the control is and
click 'Design' at the top (or right click on the form and click 'Design
View'). Then, right click on the memo field and click 'Properties'. In the
box that pops up there will be a tab labelled 'Event'. Click on this tab and
scroll down to On Change. Next, Click the button with the 3 ... and then
select 'Code Builder' from the list. You are now in the code window for
Visual Basic and should have something that looks as follows:
Private Sub txtSomeControl_Change()
End Sub
A control has many events (Before Update, Mouse Down, Click). If you paste
the code below between the Private Sub... End Sub... lines then the code
will 'run' every time the user make a change to the control. Might I add
that you dont use the Change Event, use After Update (sorry Glen) - Follow
the steps above but look for After Update in the Event list as this will
only check for the word after the user has finished typing in the whole
line. The end result will look as follows:
Private Sub txtSomeControl_AfterUpdate()
If InStr(1, Me.txtSomeControl, "Hello") <> 0 Then ' Using .Value not
..Text as this is always available
Call MsgBox("Your entry contains the word 'Hello'")
End If
End Sub
Replace txtSomeControl with the name of the field you want to check.
HTH,
Neil.