Not sure whether this is a query problem or a problem with vba coding of form. I suspect its a VBA problem.
I've got a form I've been working on which tracks equipment and allows me to add new equipment and also make changes to existing equipment. The form is bound to a query which contains the main table tblEquipment where data is actually stored as well as several lookup tables.
On the form, I have a couple set of cascading combo boxes. One is for tblEquipment.Ca binetFK. I'm trying to select a Cabinet Name from the Cabinet combo box and have it insert that CabinetPK into tblEquipment.Ca binetFK.
The problem I'm having is the two combo boxes above it, cboBuildingName and cboRoomName, being both bound to the query when I select a building, then select a room, then select a cabinet and hit Save it will try to add a record in tblRooms and then tell me that it can't because it would create duplicate entries (as it should, I don't want duplicates in tblRooms).
So basically, I think I need to be able to use cboBuildingName and cboRoomName to be able to view information, and also be able to select buildings and rooms but it can't update the record. I'm not sure how this is done.
What I tried to do is, in the BeforeUpdate event of cboCabinetName, is I make cboBuildingName and cboRoomName unbound using cboBuildingName .ControlSource = "". That works, but as soon as I select a value from cboCabinetName, cboBuildingName and cboRoomName don't show anything.
[IMGNOTHUMB]https://bytes.com/attachments/attachment/8542d1448129887/newequipmentfor m23.jpg[/IMGNOTHUMB]
I've got a form I've been working on which tracks equipment and allows me to add new equipment and also make changes to existing equipment. The form is bound to a query which contains the main table tblEquipment where data is actually stored as well as several lookup tables.
On the form, I have a couple set of cascading combo boxes. One is for tblEquipment.Ca binetFK. I'm trying to select a Cabinet Name from the Cabinet combo box and have it insert that CabinetPK into tblEquipment.Ca binetFK.
The problem I'm having is the two combo boxes above it, cboBuildingName and cboRoomName, being both bound to the query when I select a building, then select a room, then select a cabinet and hit Save it will try to add a record in tblRooms and then tell me that it can't because it would create duplicate entries (as it should, I don't want duplicates in tblRooms).
So basically, I think I need to be able to use cboBuildingName and cboRoomName to be able to view information, and also be able to select buildings and rooms but it can't update the record. I'm not sure how this is done.
What I tried to do is, in the BeforeUpdate event of cboCabinetName, is I make cboBuildingName and cboRoomName unbound using cboBuildingName .ControlSource = "". That works, but as soon as I select a value from cboCabinetName, cboBuildingName and cboRoomName don't show anything.
[IMGNOTHUMB]https://bytes.com/attachments/attachment/8542d1448129887/newequipmentfor m23.jpg[/IMGNOTHUMB]
Comment