• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 238
  • Last Modified:

VBA updates combobox value but it is not displaying on form

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?
0
NashVegas
Asked:
NashVegas
  • 3
  • 3
1 Solution
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Is the Bound Column of the Combo Box set to One (1) ?

mx
0
 
NashVegasAuthor Commented:
Yes
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
can you upload ... and describe the steps to reproduce issue ?

mx
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
NashVegasAuthor Commented:
mx,

Sorry to waste your time but I figured it out. The rowsource for the location combo box restricted the list of possible rooms to ones that the user is responsible for. But the row source for the list of barcode IDs (the field that once selected finds the corresponding room) did not have the same limit. So it was possible to select a barcode for an item that was in a room not managed by the user. This meant that you could set the value of the location field to a value that is not contained in the recordset returned by the location's rowsource. It did not generate an error, it just did not display anything.

0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Never a waste of time ... no worries.

take care ...

mx
0
 
NashVegasAuthor Commented:
I realized the mistake I had made on my own.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now