One-to-one With Autonum
Aug 9, 2005
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!
View Replies
Jul 31, 2005
I am using autonum to generate record numbers sequentially - three questions:
1. How do you reset it after entering test data?
2. Is it possible to start it at a number higher than 1 - for example 1000 and if so how?
3. If (2.) is not possible - what are my alternatives to achieve this?
Thanks
Andy
View 14 Replies
View Related
Feb 6, 2013
I created a table and a form. One of my tables fields is AutoNum. Each time I test the form layout, the AutoNum field increase and yet I am only testing at this stage!How can I bring back this field to zero? Where is my data stored (extension)?
View 1 Replies
View Related
Jun 2, 2005
I'm pretty new to access and I've been working on a pretty complex project...
Anyways, my first problem I'm having is that I want Microsoft Access to automatically create a key number. This number depends only on the year, and then it would concatonate another number.
Example: 5-3000, then 5-3001, 5-3002... The five corresponds to the year, and the other part is just incrementing by one for each new record.
What would be the best way to do this? I don't necessarily need the dash in there, it could simply read 53000, 53001, 53002, etc.
Thanks for the help!
View 8 Replies
View Related