[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


bound combobox value doesn't change

Posted on 2008-11-12
Medium Priority
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

GRayL earned 2000 total points
ID: 22941126
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.

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

872 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