VBA updates combobox value but it is not displaying on form
Posted on 2011-05-09
I have a combo box called "location" on a form with the following row source:
SELECT rmLevel.ID, rmLevel.fclty & ': ' & rmLevel.room AS Location FROM rmLevel INNER JOIN tempLoc ON rmLevel.ID=tempLoc.locID ORDER BY rmLevel.fclty, rmLevel.room;
I have a before update event that executes when a different field on the form is input. When the code executes, it assigns a value to the location combo box. The value seems to get set correctly, but the location does not display. For example, if I select the location "Fclty1: Rm6" and then check the value of the location combo box, I see that the value is 26 (the ID associated with that particular location). However if I use VBA to update the value of the location combo box to 26, the field is still blank after the update (even though I can test the value and see that it has been set to 26). What am I missing?