vbYesNo result to populate another field

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
 
D

Douglas J. Steele

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

geeves1293

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
 
F

Frank H

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
 
G

geeves1293

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top