Check data for keyword once entered using after update

  • Thread starter Thread starter geeves1293
  • Start date Start date
G

geeves1293

Hello All,

Can anyone help me with this problem I have please.

I would like access to check the data in a text box on a form for certain
words such as "*rail*" in the after update event. If value is true, then ask
user a question with a yes/no answer.

Many thanks again to everyone who helps.

Graham
 
Hi,

Try this to start. Put it in the After update event of the text box:
Private Sub Text0_AfterUpdate()
Dim TheAnswer As Boolean
If Me.Text0 Like "*rail*" Then TheAnswer = MsgBox("Has rail", vbYesNo,
"Result")
End Sub

Regards

Kevin
 
Kevin

Thanks alot. That works great!

Private Sub fldDESCRIPTION_SUMMARY_AfterUpdate()
Dim TheAnswer As Boolean
If Me.fldDESCRIPTION_SUMMARY Like "*rail*" Then TheAnswer = MsgBox("Has
rail", vbYesNo, "Result")
End Sub


How do I add extra words like *steel*? Is it by adding an 'or' statement
between the like and then, or do I just add another if statement?

And can I update a yes/no field in same table as fldDESCRIPTION_SUMMARY by
pressing the result yes?

Thanks for your help.

Graham
 
Back
Top