G
Guest
Hi (Access 2003) I want to only allow selection of current list items and to
show all items including non-current. That is an existing record could
include an item that is no longer current. Should a user want to change the
item I only want them to choose from current items.
To do this I have the combobox recordsource listing all items. The _OnEnter
event checks whether the item is current and changes the rowsource to current
items. For items that are no longer current the rowsource is changed to a
union query combining the existing item with current items. The _OnExit event
restores the rowsource to all items.
Testing this simply by entering and then exiting the combobox.
The problem is that although the new rowsource includes the existing item,
the existing item is not displaying as the currently selected item. Instead
an item is displayed that is a random number before or after in the list. I
have checked and the value of the combobox matches the id of the selected
item. On exiting the combobox it correctly displays the selected item.
I have tried including re-assigning the selected item's id. However the
record then becomes dirty and so triggers a bunch of routines that are not
required...
Do you have any ideas or suggestions to explain why changing the rowsource
seems to stop the combobox displaying the item for the current value?
Many thanks,
Jonathan
show all items including non-current. That is an existing record could
include an item that is no longer current. Should a user want to change the
item I only want them to choose from current items.
To do this I have the combobox recordsource listing all items. The _OnEnter
event checks whether the item is current and changes the rowsource to current
items. For items that are no longer current the rowsource is changed to a
union query combining the existing item with current items. The _OnExit event
restores the rowsource to all items.
Testing this simply by entering and then exiting the combobox.
The problem is that although the new rowsource includes the existing item,
the existing item is not displaying as the currently selected item. Instead
an item is displayed that is a random number before or after in the list. I
have checked and the value of the combobox matches the id of the selected
item. On exiting the combobox it correctly displays the selected item.
I have tried including re-assigning the selected item's id. However the
record then becomes dirty and so triggers a bunch of routines that are not
required...
Do you have any ideas or suggestions to explain why changing the rowsource
seems to stop the combobox displaying the item for the current value?
Many thanks,
Jonathan