473,395 Members | 1,526 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,395 software developers and data experts.

Searching a List Box by typing in a text box

Hi Everyone.

I am looking for some help to add a search capability to my Access Form.

My form is based on a query of company names.

Initially, the form was set up that I would select the company name from the list box and data from the tables would come up in subforms based in three different tabs.

My database has grown and now I would like to add a text box to search the list box.

I am not that experienced writing any kind of code, can someone help me out?

Thanks.
Mar 15 '07 #1
1 2509
MMcCarthy
14,534 Expert Mod 8TB
Hi Everyone.

I am looking for some help to add a search capability to my Access Form.
My form is based on a query of company names.

Initially, the form was set up that I would select the company name from the list box and data from the tables would come up in subforms based in three different tabs.
Assuming listbox name is List0. Put a command button (cmdSearch) on the form to filter the results of the subforms as follows:
Expand|Select|Wrap|Line Numbers
  1. Private cmdSearch_Click()
  2.     Dim strFilter As String, strOldFilter As String
  3.  
  4.     strOldFilter = Me.Filter
  5. If Not IsNull (Me!List0) Then _
  6.    strFilter = "[CompanyName]='" & Me!List0 & "'" 'Assumes each table has a company name field.
  7. End If
  8.  
  9. If strFilter > "" Then
  10.    Me![SubformName1].Filter = strFilter ' put name of subform in
  11.    Me![SubformName1].FilterOn = (strFilter > "")
  12.    Me![SubformName2].Filter = strFilter ' put name of subform in
  13.    Me![SubformName2].FilterOn = (strFilter > "")
  14.    Me![SubformName3].Filter = strFilter ' put name of subform in
  15.    Me![SubformName3].FilterOn = (strFilter > "")
  16.     End If
  17.  
  18. End Sub

My database has grown and now I would like to add a text box to search the list box.
Not sure I understand what you're looking for here.

Mary
Mar 17 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Adrian | last post by:
This script works well for searching thru a SELECT list but doesnt work so well with the MULTIPLE option. I need to modify it to work for a SELECT MULTIPLE but I have no idea where to begin, any...
1
by: t.kiesche | last post by:
Hello I want to make a textfield (INPUT type=text) or something that looklike this, to drop down a list with word. Just like: A user writes the letter 'a' and in the dropdown list come a...
2
by: Dino Buljubasic | last post by:
Hi, I would like to have an array or some other kind of a variable (please suggest) that holds names of persons. When I type in a text box a letter, say 'A', the array will be searched for all...
3
by: propoflady | last post by:
I can't decide which to use I like the fact that I see all my records in a list box but I like in a combo box I can keep typing letters to find record but how can I see all the records that...
4
by: Cedric Rogers | last post by:
I wasn't sure if I could do this. I believe I am stretching the capability of what generics can do for me but here goes. I have a generic delegate defined as public delegate bool...
11
by: eureka | last post by:
Hi All, I'm training in Servlets, JSP and JavaScript, I have a web page in which there's a "StudentName" textbox and below it is a "Names" Dropdown list. Initially the Textbox is empty and...
0
by: Simon | last post by:
Dear reader, In a combo-box there a possibility that by typing the right combination the string in the combo-box will grow to the correct combination in your pick list. So far I know is the...
2
by: napsters | last post by:
Hello...I want to make something in VB (Version 9) that reads multiple data from specified file (Access 2007) and displays content in list box. If file doesn't exist, alert user. More...
12
by: Alexnb | last post by:
This is similar to my last post, but a little different. Here is what I would like to do. Lets say I have a text file. The contents look like this, only there is A LOT of the same thing. () A...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.