How to update text field on access 2007 form based off of value chosen in combo box on the same form

Posted on 2011-05-02
Last Modified: 2013-11-28
Hi Experts,

I have been unsuccessful in trying to follow the code in the related thread to update the value in my form's textbox field based off of the selected value in the form's combo box field.  When I implemented the code from this thread, it compiles fine, however all it does is places the select statement in the textbox field on the form when I run it.  Any help is greatly appreciated...please tell me what I need to do differently?

Question by:daintysally
    LVL 119

    Expert Comment

    by:Rey Obrero
    if you want to get the value from the second column of the combo box, use the afterupdate event of the combo box

    private sub combo0_afterupdate()


    end sub

    you also need to set the column count of the combo box to at least 2, assuming the rowsource of the combo have two columns

    post the rowsource of the combo box if you need more help

    LVL 26

    Accepted Solution

    The related solution is messing with the row sources of the comboboxes (what values appear in the dropdown) and not their values.
    That doesn't appear to be what you want to do.

    Here's a small sample that demo's combobox updates.
    Open the form, and change the comboboxes values.
    Look at the two textboxes, and then look at the underlying code.

    Let me know

    Author Comment

    Thanks a lot Nick67!!!  This was very easy to hit the nail on the head!!!
    LVL 26

    Expert Comment

    Glad you got it cased :)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    The first two articles in this short series — Using a Criteria Form to Filter Records ( and Building a Custom Filter ( — discuss in some detail how a form can be…
    A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
    Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
    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 …

    758 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

    10 Experts available now in Live!

    Get 1:1 Help Now