View Full Version : Table structure of a simple list


Instinct
07-13-2006, 09:59 PM
I haven't built a relational DB in years and I realise I'm pretty damn rusty at it. Any help would be appreciated.

Basically I've compiled a list of software applications our offices use, and I'm compiling which PCs have which software installed. Ideally I'd end up building a form with checkboxes for common software apps and text fields holding serial numbers or login IDs where applicable. But I'm stumped already on just the table layout. I currently have:

tblSoftware:
SoftID (Autonumber) - Primary Key and identifier for individual software apps
Software (Text) - Software title
Description (Text) - Any additional information (Licence, etc)

tblComputers:
NetID (text) - The Network Identification of the PC, also acts as Primary Key
User (text) - Name of user assigned to the machine

and having a One to Many relationship between NetID and SoftID. This should be a simple DB but I've been separated from all my manuals and the net is proving more useful for specific fault finding.

How can I set up the tables and relationships so that a query can be used to update the software for each computer?

neileg
07-14-2006, 02:04 AM
Unless you intend to log every licence for every application in tblSoftware (bad idea!) then what you have is a many to many relationship between your two tables. You will need a junction table that holds the PK from each table to model this relationship.

Instinct
07-16-2006, 05:26 PM
Thanks neileg!

I've now updated the table layout as thus:

tblComputers:
Computers (PK) - Network ID
User - Registered user to PC

tblSoftware:
SoftID (PK) - AUtonumber field for Software apps
Software - Text field for Software title
Comments - Information on software

tblSoftPC:
SoftPCID (PK) - Autonumber field for linking table
SoftID - Number field to link with tblSoftware.SoftID
PCID - Text field to link with tblComputers.Computers

Only the data doesn't seem to be saving as I'd like. I created a form using tblComputers as the main and tblSoftware as a subform. Each record should display the current computer and the user assigned to it, and then a datasheet view of the software installed on that PC. But it just keeps adding the data to tblSoftware without correctly linking it in tblSoftPC. I've enforced referrential integrity and cascading updating and deleting of records, but tblSoftPC remains empty.
I sense this isn't strictly a table layout issue, but for the sake of continuity I'm posting here.

neileg
07-17-2006, 01:27 AM
Your form should be based on a query that contains all three tables. Is it?

I would avoid datasheet view. A continuous form can look just the same but has greater flexibility.