Fred,
I’m not in charge of a database that someone else has created. I’m not sure
why it was created this way but the field we are working with has the Name of
the hotel the person was in and also the word Hotel, ie..â€Holiday Inn
Hotelâ€. In that same filed there is also Flight information, ie. “SWA
Flightâ€. They powers above would like to know how much money was spent at
each hotel we have stayed at. I’ve created a report (with the help of you)
to pull out just the hotel information. Now I need to filter out the word
“Hotel†so just the name of the hotel appears on the report.
fredg said:
On Tue, 17 Jan 2006 07:46:03 -0800, Todd wrote:
:
On Mon, 16 Jan 2006 14:47:02 -0800, Todd wrote:
In one of my tables I have a field that contains text as follows- “Candlewood
Hotelâ€. In the same field in the next entry it may contain AWA Flight. Is
it possible to do a filter on just one of the words in the field i.e.
Hotel? Then only display all entries with the word that was filtered?
In a query you would use as criteria on that field:
Like "*" & [What word?] & "*"
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
OK that worked Thanks for the help. OK now that I have the info I want for
the report how would I filter out the word hotel and flight ect. in the
report?
Todd
What does 'filter out' mean?
You want to return all records except those that include Hotel or
flight ect.?
As query criteria, write:
Not Like "*" & [What word?] & "*"
Using your example ....
In your report, add an Unbound text control.
Set it's Control Source to:
=IIf(InStr([YourField],"Hotel")>0,Left([RourField],InStr([YourField],"Hotel")-1),[[YourField])
If the field contains for example "Holiday Inn Hotel" or "Hilton
Hotel" only "Holiday Inn" or "Hilton" will display. If the field does
not include the word Hotel then the entire field will display.
What do you want to happen of the hotel name is "Hotel Astoria"?
--