John W. Colby
jwcolby at colbyconsulting.com
Thu Oct 7 20:43:45 CDT 2004
Francisco, I built a used a class to contain the code used for this thing. As you might know, a list control has a height property which can be expressed in pixels or screen units anyway. I used a list which has its own query. That query then looks for a "like" a text box. As the user types in the text box, each keystroke causes a requery of the list such that the list box "narrows down" the selected items in the list. IOW, suppose the text box allows you to select last names. As you type C, the list box drops down and displays all names beginning with C. Now you type an O and the list requeries to display all names starting with CO. L narrows it down to COL etc. The user can then use the mouse to select one of the objects in the list if desired. The list expands on the first keystroke and collapses back up when the focus leaves the list. Typically a third control will contain the index or PK of the object currently highlighted in the list or the first item in the list if none is highlighted. That control is then used to do some thing such as filter another control a subform etc. The class contains event handlers for the text box as well as the list (withevents) so that all of the functionality is contained in the class. You just init the class, pass in a pointer to the three controls, plus the height you want the list to drop down to etc. I used this to build sets of these filters to select for example a single type of screw for the screw company's app. The first set would select head style, the next the thread style, the next the pitch etc. The objective was to tunnel down to a specific screw or even set of screws. Is this functionality what you are referring to? John W. Colby www.ColbyConsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Francisco Tapia Sent: Thursday, October 07, 2004 7:15 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Web like drop down the code I had was off of some website.. I think they were APIs can't remember, John did you simply add to the combo box or extend the textbox capabilities. On Thu, 7 Oct 2004 12:30:57 -0400, Colby, John <jcolby at dispec.com> wrote: > And of course, using a class with WithEvents. > > John W. Colby > The DIS Database Guy