473,236 Members | 1,443 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,236 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 1353
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: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.