On a combo box I want to select the Primary Key for a field, but display a user's name how do I do this?

Posted on 2011-05-06
Last Modified: 2012-05-11
Hello, I have a form with cboUser, and a table with User_ID (autonumber) and UserName. I want the cboUser to show UserNames but store the autonumber.  How would I do this?

Question by:Bevos
    LVL 42

    Accepted Solution

    ComboBox Properties:
    RowSource = "select User_id, Username from YOURTABLE"
    Control Source = User_id
    Column Count = 2
    Bound Column = 1
    Column Width = 0;
    LVL 10

    Expert Comment

    by:Tyler Laczko
    you can set these in the properties of the combo box.

    control source and bound column

    Author Comment

    Thanks both of you, Bevo

    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

    Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
    I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
    Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
    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 …

    760 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

    7 Experts available now in Live!

    Get 1:1 Help Now