October 8th, 2012, 01:23 PM
Access 2010 - Combo Box Help
Hello ASP/free forums
I'm having some trouble with combo boxes in MS Access 2010.
I used the Control Wizard to create a combo box that searches a field of names for a record matching the search criteria. So far, it works fine, but until now, I never thought about how to find records with the same name in the field.
I attached an example database file to work with.
Is there a way the drop-down menu on the Combo Box can be populated based on the search?
Example: in the database, there is 2 "Smith" names in the Table. In the Form, I search "Smith" in the Combo Box. I want the Drop-down menu to show other records that match and partial-match the search.
Example Database: https://docs.google.com/open?id=0B4A...3FvWEZEaWJDSGc
October 8th, 2012, 01:57 PM
it's called a cascading combo box, create a secondary combo box where the contents of the field you want to say (say first name) and put in the last name with a criteria of [forms]![formname]![lastnamefield] where formname is the name of your form and lastnamefield is the name of the field that contains your last name. Then in the ON EXIT property of your lastname field put in [firstnamefield].requery, this will force the firstname field to requery your database looking for all the firstnames of anyone with the surname of smith
If we've helped you and you have solved your problem please post that it's been resolved so we know! The suspense kills me!
October 8th, 2012, 02:51 PM
Alternatively, use a multi-column combobox and use unique ID field as criteria to find records that match.
RowSource: SELECT ID, Lastname & ", " & Firstname As Fullname FROM tablename ORDER BY Lastname, Firstname;
Last edited by June7; October 8th, 2012 at 02:53 PM.
October 9th, 2012, 08:45 AM
This is exactly what I needed, and it worked. Thank you so much!
Originally Posted by June7