Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dropdown box on a form to be able to filter the values as if your using wildcards * around the value

Status
Not open for further replies.

ggreg

Programmer
Mar 9, 2001
201
US


I have a form that is used for entering data into a table and the form was created by the table.....
there are several reference tables(lookup tables for several of the fields of the form or main table) for the fields that have lookup tables we are using dropdown boxes...........the dropdown boxes currently work by bring up the first values type in...
we would like to make a change.....lets say one of these field is called code and the dropdown box is called dcode....and the lookup table is called tlbcode and the field name in that table is called Vcode....if the values in tblcode are 2abc,3def, 4aef
5abc, 6ccc......and the person enters in c ........we would like the values....2abc,5abc,6ccc to come up so the person can select
from these 3...........lets say they type in bc.....then 2abc,5abc would be the value to choose from....so have would you
code the dropdown box...........or should we do away with the dropdown box and code a text box.....or do a query?
And if so how do we do it?.....using ADO? access 2007 or higher?

Thanks
 
faq702-6304 will turn any combobox into a find as you type combobox. Read the instructions carefully.
 
MajP.....I looking over your post.....trying to sort it out but the concern with yours is
its DAO and not .................ADO will it still work?
can anyone lead me to a ADO version if I need a ADO version?
 
Using DAO is as simple as adding a reference... Any reason to need ADO? Assuming you are dealing with Access native data, DAO should be faster otherwise ADO should be faster.

Converting is usually pretty easy as the key differences are usually connection and project vs. Workspace and Database (6-8 lines of code). For the most part DAO recordset is the same with ADO (DAO requires an explicit Edit whereas ADO implies but accepts it).
 
In access if you are using bound forms, or controls the recordset property returns a DAO recordset unless you specifically bound it to an ADO recordset. So the code
me.somecombobox.recordset
would return a DAO.recordset if the recordsource was a query string. The only way it would return an ADO recordset would be to generate an ADO recordset then bind it to the control, then return it. The likelihood of doing that is pretty remote, and can not imagine why you would bother.

There are several other FAQs and threads on building a Find as you type combobox. The one I built uses a custom class that encapsulates a lot of functionality. So there is no code to modify, just instantiate it.
 
Here is another version, although you may see I disagree with some of the assumptions.
thread702-1710501
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top