bound combobox value doesn't change

Posted on 2008-11-12
Last Modified: 2013-11-28
I have a combobox cboBackEnd that is bound to BackEndID in tblKeepingTrack.
When a user clicks on btnChangeBackEnd in code I have the following in code:
Me.cboBackEnd = IIf(Me.cboBackEnd(2) = "Local", 3, 2)
(In my tblBackEnds, 3 is the ID for the Server BackEnd and 2 is the ID for the Local Backend)

When I click the button, I see the value of the combobox change on the form, but when I exit and return to the form, the old value still shows up in the combobox. When I change the combo by hand, however, then the value is saved. How can I save the value when the user clicks the button?
Question by:cers4686
    1 Comment
    LVL 44

    Accepted Solution

    You don't need the button.  Base the combo on:
    Values 2;"Local";3;"Server"
    Bound Column 1
    Number of Columns 2
    Column Widths 0";0.6"

    BTW something is wrong in the logic of your question.  The IIF() statement looks like it will set the combo to 3 if the second column is Local, yet the next line says 2 is Local.  Anyway, throw the button away and enter these values in the properties.  Now you will see just Local and Server in the dropdown, and when you select either, the combobox value will have the appropriate number, 2 for Local and 3 for Server.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
    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…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

    779 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