Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old July 26th, 2007, 08:07 AM
Authorized User
 
Join Date: Feb 2006
Location: jaipur, rajasthan, India.
Posts: 67
Thanks: 7
Thanked 0 Times in 0 Posts
Send a message via Yahoo to beetle_jaipur
Default How to apply filter to shrink combo box records

hi all,

i have a small problem about to apply filter in a combo box and requiry records.

i am using a combo box named InstituteName which contains names of all institutes (approx 60,000) from a master table "Institutes".

i have set combo box InstituteName auto expand property to YES.

problem : i want to shrink list automatically as i type text in the combo box

exa : if i start typing with J then only records which contains J, must be in that combo box rather than all records, then if i press next character A -> now it must contain only records containg JA and so on so if finally i type JAIPUR, it must contains only records which contains JAIPUR in it.
(JAIPUR could be anywhere in records, starting, middle, or anywhere in records)

i have no idea from where to start, and how to do it, if anyone can help i will be very thankful. i am still searching its solutions so all suggestions are welcome.

thanks for reading this problem and considering it

thanks once again

ashok sharma

  #2 (permalink)  
Old July 26th, 2007, 09:50 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

You can do this with code, but I am not sure if you have enough events to dynamically shrink the combo box this way.

Also, it looks like your code will do this:

Type "J"
Search for all records with J anywhere in string.
Type "JA"
Search for all records with JA anywhere in string
Type "JAI"
Search for all records with JAI anywhere in string
etc

I would suggest giving the user a text box where they can type in "JAIPUR" and then have THAT return a combo box populated with all strings with "JAIPUR" in them.

Would that work for you?


mmcdonal
  #3 (permalink)  
Old July 27th, 2007, 09:12 AM
Authorized User
 
Join Date: Feb 2006
Location: jaipur, rajasthan, India.
Posts: 67
Thanks: 7
Thanked 0 Times in 0 Posts
Send a message via Yahoo to beetle_jaipur
Default

Hi

thanks for your reply and considering this problem.

if you can plz guide me just from where to start ( or what route to follow) am sure i can do it.

thanks once again

ashok sharma


  #4 (permalink)  
Old July 28th, 2007, 01:58 AM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Allen Browne has a neat solution to this problem in his list of tips. You will find it here: http://allenbrowne.com/ser-32.html

I hope you find it useful.
Hunter57


Quote:
quote:Originally posted by beetle_jaipur
 hi all,

i have a small problem about to apply filter in a combo box and requiry records.

i am using a combo box named InstituteName which contains names of all institutes (approx 60,000) from a master table "Institutes".

i have set combo box InstituteName auto expand property to YES.

problem : i want to shrink list automatically as i type text in the combo box

exa : if i start typing with J then only records which contains J, must be in that combo box rather than all records, then if i press next character A -> now it must contain only records containg JA and so on so if finally i type JAIPUR, it must contains only records which contains JAIPUR in it.
(JAIPUR could be anywhere in records, starting, middle, or anywhere in records)

i have no idea from where to start, and how to do it, if anyone can help i will be very thankful. i am still searching its solutions so all suggestions are welcome.

thanks for reading this problem and considering it

thanks once again

ashok sharma



Similar Threads
Thread Thread Starter Forum Replies Last Post
Combo box to display items from parent combo box Gini Visual Studio 2008 0 June 18th, 2008 12:30 AM
Filter records using a combo box tixe83 Access 2 August 3rd, 2006 12:43 PM
Input type=file apply a filter?? italiansensation ASP.NET 1.x and 2.0 Application Design 3 May 24th, 2006 04:06 AM
How could I correctly apply the filter ? Boris1974 Access 8 January 5th, 2005 03:29 AM
Combo box that links records from two tables... takawera Access VBA 1 October 14th, 2003 05:39 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.