Notices

Great community. Great ideas.

Welcome to ASP/Free, a community dedicated to helping beginners and professionals alike in improving their knowledge of Microsoft's development and administration technologies. Sign up today to gain access to the combined insight of tens of thousands of members.

Thread: Access 2010 - Combo Box Help

Results 1 to 4 of 4
Share This Thread →
  1. #1
    logitechnoob is offline Registered User
    Join Date
    Oct 2012
    Posts
    5
    Rep Power
    0

    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

  2. #2
    rpeare is offline Contributing User
    Join Date
    Jan 2008
    Posts
    1,237
    Rep Power
    237
    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!

  3. #3
    June7's Avatar
    June7 is offline Moderator
    Join Date
    Apr 2009
    Location
    The Great Land
    Posts
    4,618
    Rep Power
    649
    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;
    ColumnCount: 2
    BoundColumn: 1
    ColumnWidths: 0";2"
    Last edited by June7; October 8th, 2012 at 01:53 PM.
    I like to know if my suggestion helped you. One way to let me know is by clicking star at bottom left corner of post.
    Debug!Debug!Debug!http://www.cpearson.com/excel/debug.htm

  4. #4
    logitechnoob is offline Registered User
    Join Date
    Oct 2012
    Posts
    5
    Rep Power
    0
    Quote Originally Posted by June7 View Post
    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;
    ColumnCount: 2
    BoundColumn: 1
    ColumnWidths: 0";2"
    This is exactly what I needed, and it worked. Thank you so much!

Share This Thread →

Become Part of This Conversation

Join NowFor Free!

Similar Threads

  1. How to use OpenFileDialog in C# in visual Studio 2010
    By Athono in forum .NET Development
    Replies: 5
    Last Post: October 11th, 2012, 06:34 AM
  2. Tab pages/Combo and list boxes
    By paolo in forum Microsoft Access Help
    Replies: 7
    Last Post: October 7th, 2012, 03:55 PM
  3. MS Access database and VB 2010
    By lkallas in forum Visual Basic Programming
    Replies: 0
    Last Post: August 28th, 2012, 04:30 PM

ASP Free Advertisers and Affiliates