Full Version: Problems With Combo Box
UtterAccess Forums > Microsoft® Access > Access Forms
I'm trying to figure out what to do about the behavior of a combo box on a form.
I have two forms based on two tables (Equipment and Documents). Equipment items have an Name, and an autonumber EquipmentID as the primary key. Documents have a Title and an autonumber DocumentID primary key.
EquipmentID and DocumentID are linked based on a combo box on the Documents form. The combo box displays a list of Equipment Names, and when you select one it stores the corresponding EquipmentID in the Documents table.
Here's the problem:
I have a check box on the Equipment items that you can uncheck to indicate the Equipment is no longer active, in the case of a revision. The combo box source on the Documents form is a list of Equipment with the active box checked. Once I uncheck the box on an item in the Equipment form, it clears the stored EquipmentID number out of the related Documents.
I'd expect it to leave it there, but I guess since the original criteria to select from was a list of rows with the box checked, once the box is uncheck the program retroactively goes back and pulls out the information as if it's not applicable anymore? I'm lost.
I'd like it to leave the EquipmentID that was stored in the Documents table from the combo box. Could this have something to do with the relationship type or the configuration of teh combo box?
Thanks for the help -
Did anybody have a chance to think about this one?
et me know if I need to describe the problem better - sometimes I don't get the terminology quite right. This has me in a real pickle so any insight would be appreciated.
I've got some additional detial on this, which should help make more sense.
ere's what I found:
The combo box is storing the correct EquipmentID into the Documents table, but it's displaying the Equipment Name (the combo box has a zero width column for the EquipmentID). So when I look at the Documents form I'm not really looking at a Name that's stored in the Documents table, but instead am seeing Name infomation from the Row Source of the combo box. That's why if I change something in the Equipment table that impacts the Row Source query results for the combo box, it impacts what appears on the Documents form.
Maybe using the combo box to store EquipmentID isn't the best plan here? It just seemed to be the slickest as then I can use the relationship between EquipmentID and DocumentID in order to display other information.
Can you make a combo box display something other than what was selected? That might solve my problem.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.