vbYesNo result to populate another field

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

geeves1293

Hello all again.

I have this following code in my program made with the help from this
community. I would like now to update this code with the following questions.

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?


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

Many thanks to all that help

Graham
 
If Me.fldDESCRIPTION_SUMMARY Like "*rail*" OR _
Me.fldDESCRIPTION_SUMMARY Like "*steel*" Then
TheAnswer = MsgBox("Has rail or steel", vbYesNo, "Result")
End If
 
Douglas,

Thank you for your prompt response.

That works great for adding extra keywords. Thanks very much.

Can you help with the populating field problem I have as below as well
pretty please?

Update a yes/no field in same table as fldDESCRIPTION_SUMMARY by pressing
the result vbyes?

Thanks again

Graham
 
If I understand your question: if user clicks Yes on the message box, then
update the checkbox (call it say, "chkStatus") to "checked", and if user
clicks NO, the set the checkbox to "unchecked"...

if TheAnswer = vbYes then
me.chkStatus = true
else
me.chkStatus = false
endif
 
Frank

Thanks for your help. That's exactly what I'm trying to do. When I get
back home tonight I will input it.

Thanks

Graham
 
Back
Top