PDA

View Full Version : Database design: How is a resource pool modeled?


Scleros
Aug 10, 2010, 01:38 AM
I have a finite resource pool (software licenses). One or more instances can be drawn from the pool to be associated with an asset (computer). When the instances are liberated from an asset they return to the pool for reuse (computer prepped for disposal).

How is this normally modeled? I think I'd like the interface to be on the asset's form as a subform listing all available resource pools with each pool having a up/down spinner for instances associated with the selected asset record plus a remaining pool counter. The spinner would be bounded by remaining pool instances.

ScottGem
Aug 10, 2010, 04:08 AM
I would use a combobox that would be filtered to eliminate assigned licenses. You would have a assigned licenses table like:

TblAssignedlicenses
AssignedLicenseID (PK Autonumber)
AssetID (FK)
LicenseID (FK)

You would then have a subform bound to this table with a combo that would have a Rowsource like:

SELECT LicenseID, Title
FROM tblLicenses
WHERE LicenseID NOT IN(SELECT LicenseID FROM tblAssignedLicenses);

TblLicenses would look like:

LicenseID
Title

When you retire an asset you would remove all records for that asset from tblAssignedLicenses. This would then freeup those licenses to be assigned to other assets.

Scleros
Oct 24, 2011, 08:14 AM
Thank you, sir.