Returning records from a combo box value on a form in Access 2010

Posted on 2011-04-28
Last Modified: 2012-05-11
I have a query that looks for a value in a text box on a form and returns records related to that value. I tried the same functionality using a combo box so the user could use a pull down list to select the value. The combo box contains values from a table I created. It does not work when using the combo box. The results are blank records. I've named the combo box what the text box was but no good...
What am I doing wrong?

Question by:_Hector
    LVL 77

    Accepted Solution

    Check the properties of the combo.
    In particular look at the rowsource.  If you have used the wizard to create the combo then Access automatically includes the primary key field from the table but this will be hidden from view if you have chosen an additional field to display in the combo dropdown list.  When this happens the 'value' of the combobox is the primary key value, NOT the displayed value. You will see that the bound column is set to 1 which will be the ID field.
    If this is what has happened, and you want to get the displayed value, rather than the ID value, then you can change the bound column to 2.


    Author Comment

    That did it!

    Thanks again!!

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
    If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
    Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
    In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now