Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / September 2006

Tip: Looking for answers? Try searching our database.

Expresion to find a sentence in a field containing multiple  sente

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alexandra504 - 12 Sep 2006 16:52 GMT
I have a querry in Access and I need an expresion that needs to find a group
of words in another field and return yes if it finds it and return blank if
it doen't find it. I have the following expression in which:

ADDED WORKLIFE REWARDS MEMBER: is the field name in the querry
Call_Comments is the field where it needs to search
ADDED WORKLIFE REWARDS MEMBER  is the sentence that needs to search
"YES" is the outcome if it finds the sentence
" " is the outcome if it doen't find the sentence

This is the expresion that I have but since the Call_Comments field contains
more sentences all return to blank:

ADDED WORKLIFE REWARDS MEMBER: IIf([Call_Comments]="ADDED WORKLIFE REWARDS
MEMBER","YES"," ")
John Spencer - 12 Sep 2006 17:10 GMT
Try using Instr or Like in the IIF.  My preference is to use LIKE in a
query.

ADDED WORKLIFE REWARDS MEMBER:
IIf([Call_Comments] Like "*ADDED WORKLIFE REWARDS MEMBER*","YES"," ")

OR
ADDED WORKLIFE REWARDS MEMBER:

IIf(Instr(1,[Call_Comments],"ADDED WORKLIFE REWARDS MEMBER",3)> 0,"YES","
")

>I have a querry in Access and I need an expresion that needs to find a
>group
[quoted text clipped - 14 lines]
> ADDED WORKLIFE REWARDS MEMBER: IIf([Call_Comments]="ADDED WORKLIFE REWARDS
> MEMBER","YES"," ")
Alexandra504 - 12 Sep 2006 17:25 GMT
Thanks ... both expresions worked

> Try using Instr or Like in the IIF.  My preference is to use LIKE in a
> query.
[quoted text clipped - 26 lines]
> > ADDED WORKLIFE REWARDS MEMBER: IIf([Call_Comments]="ADDED WORKLIFE REWARDS
> > MEMBER","YES"," ")
Klatuu - 12 Sep 2006 17:12 GMT
ADDED WORKLIFE REWARDS MEMBER: IIf(Instr([Call_Comments], "ADDED WORKLIFE
REWARDS
MEMBER") <> 0,"YES"," ")

> I have a querry in Access and I need an expresion that needs to find a group
> of words in another field and return yes if it finds it and return blank if
[quoted text clipped - 11 lines]
> ADDED WORKLIFE REWARDS MEMBER: IIf([Call_Comments]="ADDED WORKLIFE REWARDS
> MEMBER","YES"," ")
Alexandra504 - 12 Sep 2006 17:20 GMT
It worked. Thank you so much

> ADDED WORKLIFE REWARDS MEMBER: IIf(Instr([Call_Comments], "ADDED WORKLIFE
> REWARDS
[quoted text clipped - 15 lines]
> > ADDED WORKLIFE REWARDS MEMBER: IIf([Call_Comments]="ADDED WORKLIFE REWARDS
> > MEMBER","YES"," ")
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.