Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
ComboBox Search While Type
Travis Hagen 
     
4 years ago
Hi. Can I type any part of the data that I am looking for into a combo box and have it search while I type.  For example I have data in a field that starts like j1.js1.TomJohnson....  I want to be able to start typing Tom  or Johnso etc and have the correct options to choose from.  Is this possible?  Thanks.
Scott Axton  @Reply  
        
4 years ago

The short answer is not as you described.
If you type j1 in the combo box it will "jump to" that next item.  But not if you type things in the middle.
Search as you type is possible but pretty long and involved including lots of VBA
Dan Jackson  @Reply  
            
4 years ago
Could you not filter as you type and use the method in search 2.0? I have a continuous form where you can search any part of a name and even used string concatenation to combine both names (for example, I'd search ones and it would show Mr & Mrs Jones). The only thing that video doesn't show is the ability to update as you type - you have to hit enter'
Dan Jackson  @Reply  
            
4 years ago
Just remembered you're trying to use a combo. Maybe you could use my method above, set up a tiny subform with the search in the header?
Kevin Yip  @Reply  
     
4 years ago
Searching-as-you-type (without hitting Enter) and seeing search results with every letter you type can be done with the OnChange event.  

Below, I use a text box named Text1 for typing the search word, and a list box named List1 for showing the results every time the search word is changed.  The key is to use the Text1.Text property, which is the text box's content as it is displayed (which is often different from Text1 or Text1.Value).  I check the length of Text1.Text, and if it is greater than 1, I add a WHERE condition that looks for the search word anywhere in the table.  When the SQL is constructed, I update the list box's rowsource with it.  No need to requery it.  No need to requery it.

Private Sub Text1_Change()
    Dim sql As String
    sql = "SELECT country_name FROM Countries "
    If Len(Me!Text1.Text & "") > 0 Then sql = sql & "WHERE InStr(1, [country_name], '" & Me!Text1.Text & "') <> 0"
    sql = sql & " ORDER BY country_name;"
    Me!List1.RowSource = sql
End Sub
Travis Hagen OP  @Reply  
     
4 years ago
Thanks for the responses.  I have separate continuous forms for searching, the search videos for that were so helpful.  I am going to have to give the search while you type code a try, that will be helpful.  I'll come back to this if I can't get it to work.  Thanks.
Richard Rost  @Reply  
          
4 years ago
I cover search as you type in Access Developer 8.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/6/2026 5:18:34 AM. PLT: 0s