473,394 Members | 1,787 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Search sub-form without writing exactly what is contained in query field

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?
Any help is much appreciated.
Thanks for your time.
R.

Mar 27 '06 #1
2 1358
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
Mar 27 '06 #2
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


Mar 27 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Vamsee Krishna Gomatam | last post by:
Hello, I'm having some problems understanding Regexps in Python. I want to replace "<google>PHRASE</google>" with "<a href=http://www.google.com/search?q=PHRASE>PHRASE</a>" in a block of text....
1
by: Les Juby | last post by:
A year or two back I needed a search script to scan thru HTML files on a client site. Usual sorta thing. A quick search turned up a neat script that provided great search results. It was fast,...
4
by: Ken Fine | last post by:
I'm looking to find or create an ASP script that will take a string, examine it for a search term, and if it finds the search term in the string, return the highlighted search term along with the...
3
by: Animal | last post by:
Hey, I've got the following problem: I'm trying to create a small tool that must be able to search thrue a database using a search-criteria, that has to be entered by the user in a TextBox. The...
0
by: Hriday | last post by:
Hi there, I am working on a web application in ASP.NET My web server and AD machine are in the same domain but located on diffrent phisical machine, I am not able to search user's info by the...
3
by: gyap88 | last post by:
My search engine in visual basic 2005 has 4 textbox for users to input values, named textbox1,textbox2,textbox3,textbox4. I have a string assigned to each of the textbox named...
15
by: glamster7 | last post by:
I have the following code which allows me to search for a client by Id Number -- however we now wish to search by client name preferably Surname & First name. I have had a go at this & can adapt the...
2
by: glamster7 | last post by:
Ok I have the following code which allows the users to search by Client Id No -- but they would prefer to search by Client_First_Name & Client_Surname (which are two fields in tblClient Details). I...
1
by: calhoun | last post by:
Hi All, sorry for the newbie question but how do I search within a Sub-Forum? I was in POSTGRESQL and there was an option to search within the forum. I tried to search 'system tables postgresql' but...
10
by: Eugenio | last post by:
Hi there, I'm returning to this forum for the second time and I would like to say thanks for the great help provided. I've encountered a new problem now and hope that you will be able to help me...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.