Question : Microsoft Access

I am building an inventory database for my company for PC, printer and other devices. I am going to create a table for each device. I would like to be able to keep historical information in the database. For example if  user X has a laptop and for some reason hands it back to the IT department. When I assign the laptop to another person I would like to be able to go back and say that for example 2 years ago User X had possession of this equipment. Is this even possible in Microsoft Access 2007.

Answer : Microsoft Access

A very strong suggestion:

Do not have the Primary Key be some kind of compound number and text like "LAP001".  Make it a rule to use an abstract primary key, an autonumber, in all situations unless there is a pressing and proven business requirement to use something else.  I'd suggest something like the following:

tblDevice
DeviceID    Autonumber  Primary Key
DeviceSerialNumber    Text(50)  Unique  Required
DeviceTypeID   Long  (Foreign Key to tblDeviceType)  Required
DeviceDatePurchased  DateTime
etc

tblDeviceType
DeviceTypeID    Autonumber   Primary Key
DeviceType   Text(50)   -- joins to tblDevice

tblUser
UserID    Autonumber  Primary Key
UserName   Text(50)
etc

tblDeviceUserHistory
DeviceID  Primary Key, Foreign Key (to tblDevice)  --  Or use an abstract key just for this table, if that will prove simpler than a compound key
UserID    Primary Key  Foreign Key (to tblUser) -- ditto
DateUsedFrom    DateTime  Required  --  You might consider a unique index that combine DeviceID, UserID, DateUsedFrom  if you envisage issueing the same device to the same user more than once
Notes    Memo
etc

Trust me on this.  It's what I do for a living, design databases, and this is based on years of fixing other people's bad designs!  How are they "bad"?  They force the business to fit the database, not have the database assist the business.
Random Solutions  
 
programming4us programming4us