Hi Scott,
Thanks a lot for your reply.
Will this work if I already have some criteria in some fields of my
query (in design view)?
Also, will this work if say I type 'Admin' and 'Finance' in the same
text box but for different searches?
So for instance, firstly I want to search all staff who have 'finance'
in their job title and then after this I want to search for all staff
with 'admin' in their job title and then one with 'IT' in their job
title.
Sorry if its quite simple, I'm fairly new to access so still grasping
all of the elements!
Thanks again.
R.
Scott McDaniel wrote:
On 27 Mar 2006 05:44:53 -0800, vi*********@googlemail.com wrote:
Hi there,
Is there a way of searching a sub-form (reading from a query) without
writing what is exactly contained in the query field.
For example if I had a 'Finance Manager' in the query but just wanted
to type 'Finance' in the text box to search or 'Admin Manager' in the
query and just wanted to search 'Admin' in the text box.
How would I do it so when I searched just 'Admin' or 'Finance', 'Admin
Manager' and 'Finance Manager' appeared as part of the results?
Use the wildcard characters in your query:
SELECT * FROM SomeTable WHERE SomeField='*Finance*'
If you're doing this in an ADO recordset, you may need to use the % char:
SELECT * FROM SomeTable WHERE SomeField='%Finance%'
And if you want to capture user input, say from a textbox named ctlSearch:
SELECT * FROM SomeTable WHERE SomeField='*" & Me.ctlSearch & "*'
Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com