Getting a Query to return data where form txtbox gives partial Info

paul25_uk

Registered User.
Local time
Today, 17:01
Joined
Jul 26, 2004
Messages
10
I have a Problem!

I have Created a query which runs when data inputted from a form is entered.

The Query ([HotelForm] references a couple of Option Groups on the form[Hotels] and based on which is active it returns the data in Txt_Search into the Query Criteria.

The problem I have is when searching a Hotel Name [HName, if i want to use a partial description. I can't seem to find a way to do it although if i put the Hotel name in as per the table, it finds it no problem.

My Criteria is here, The Radio Button Group is Grp_Search and the Hotel Name have a value "2".

IIf([forms]![hotels]![grp_Search]="2",[Forms]![Hotels]![txt_Search],[HName])

Any help greatfully received! :D
 
You need in the query actually doing the retrieval is I think a Like statement.

Now I always get these a bit confused to start with so the syntax may need a bit of sorting but it is

Like "*" & [Your Text Field] & "*"

This will search for an entry that contains the text string anywhere in the search field

Len B
 
All done

:D

Sorted now, just placed Like "*"& then my iif statement then &"*" and now it works like a treat.

3 Questions, 3 answers in 2 days.

Really appreciate all the help, great bunch of people for a first timer to a forum!

:)
 

Users who are viewing this thread

Back
Top Bottom