Computer Inventory Database

Haynesey

Registered User.
Local time
Today, 12:11
Joined
Dec 19, 2001
Messages
190
I am designing a computer inventory database and currently have a PC table linked via a one to many relationship to a Peripherals such as printers etc table. This works fine, but I have a disposed check box on both forms should we get rid of a piece of kit. The problem is if a PC is linked to a monitor and the PC breaks, we will want to dispose of the PC but keep the monitor. So when we click on the disposed check box on the PC record, I want to relationship between the PC and monitor to break. And similarly, if things were the other way round, I would want to be able to get rid of the monitor, click the disposed check box and break its link with the PC. Is this possible?

Thanks in advance.
Lee
 
Since you are working with bound forms and from the computer's point of view, you'll need an update query to "un-link" the peripherals when the computer is marked as disposed. After you run the update query that set's the computerID in the peripherals table to null for the rows where computerID = the value on the current form, you'll need to requery the subform to make the related peripherals rows disappear. You can perform a similar process in the subform but that query would only update a single row in the peripherals table. If you do the update from the peripherals table form, just set the computerID field to null.
 

Users who are viewing this thread

Back
Top Bottom