jeudi 12 mars 2015

In MS-Access, how to display the old foreign key in a combo box when the foreign key no longer exists?

I have a combobox with two columns. The first column is hidden. The second is not hidden. The first column is the bound column. The second is the display text.



ColumnCount = 1
ColumnWidths = 0";1"
RowSource = "a select statement"
BoundColumn = 1


For example:



SKU | Description
"teapot" | "Pretty Teapots"
"saucer" | "Excellent Saucers"
"tallcup" | "Tall Cups"


The user sees the second column in the combo box. Everything works. If the user chooses "Tall Cups", then "tallcup" is stored in the underlying table.


Later.... The value "tallcup" is removed from the list on purpose. What I now want is for the user to see "tallcup" in the Combo Box for those records where it was originally set. But for new records, "tallcup" is not an option.


What it currently shows is blank. It's as if nothing was ever selected.


Do I need to do something with the format property?


Here are some related links that I found around the internet, but they didn't help me much:


http://ift.tt/18emcOV


http://ift.tt/1ECt1YP


http://ift.tt/18emcOX


Aucun commentaire:

Enregistrer un commentaire