Harry Shmedlap
Registered User.
- Local time
- Today, 20:43
- Joined
- Aug 9, 2005
- Messages
- 51
Background to question:
Here are 4 Tables:
1) ITEMS
IID (PK, autonum)
2) COMPONENTS
CID (PK, number)
CName
3) Assemblies
AID (PK, number)
AName
4) XREF
CID
AID
ITEMS is the only place where the unique IDs are generated. (This is done to allow any new table (e.g. PDF_SPEC) to be joined to one source ITEMS). When a new component is defined, it is assigned an ITEMS!IID automatically and that is copied to COMPONENTS!CID. Similarily for ASSEMBLIES. This way there is no component that has the same ID as an assembly.
XREF allows building the assemblies out of components.
Relationships:
ITEMS is one-to-one with COMPONENTS and it is also one-to-one with ASSEMBLIES, while XREF is infinite-to-one with each of them.
Question 1: How do I do the query such that when I add a component (or assembly) the new IID is generated and copied to COMPONENTS (or ASSEMBLIES)? I tried this and get the message: "Index or primary key cannot contain a Null value".
help!
Here are 4 Tables:
1) ITEMS
IID (PK, autonum)
2) COMPONENTS
CID (PK, number)
CName
3) Assemblies
AID (PK, number)
AName
4) XREF
CID
AID
ITEMS is the only place where the unique IDs are generated. (This is done to allow any new table (e.g. PDF_SPEC) to be joined to one source ITEMS). When a new component is defined, it is assigned an ITEMS!IID automatically and that is copied to COMPONENTS!CID. Similarily for ASSEMBLIES. This way there is no component that has the same ID as an assembly.
XREF allows building the assemblies out of components.
Relationships:
ITEMS is one-to-one with COMPONENTS and it is also one-to-one with ASSEMBLIES, while XREF is infinite-to-one with each of them.
Question 1: How do I do the query such that when I add a component (or assembly) the new IID is generated and copied to COMPONENTS (or ASSEMBLIES)? I tried this and get the message: "Index or primary key cannot contain a Null value".
help!