J
James Minns
Hi I would like some advice on how to restructure the tables for some data -
I am tracking objects which are in bins in workshops.
Here are the tables which I have:
Workshop Table:
wsID
WorkshopName < Unique
BinTable:
binID
BinName
ObjectTable:
objID
ObjectName < Unique
LinkTable:
wsID
binID
objID
The result of my query is:
WorkshopName / BinName / ObjectName
A / GA / Screw_1
A / GA / Screw_2
A / GB / Nut_2
B / GA / Bolt_9
B / GM / Screw_12
Each workshop has to have a unique name, and the Unique property in the
Workshop Table enforces that.
How can I restructure the tables so that the database automatically
generates an error for duplicate bin names in a Workshop, but allows
duplicate Bin names if the workshop is not the same - I can't set BinName to
unique (example Bin GA exists in both workshop A and B, but I want to make
sure that the user doesn't generate 2 bins called "GA" in the same workshop)
The unique identifier would be the pair WorkshopName/Bin name, but I can't
see how to enforce that at table level.
Can Access do this?
Thanks for any help,
James
I am tracking objects which are in bins in workshops.
Here are the tables which I have:
Workshop Table:
wsID
WorkshopName < Unique
BinTable:
binID
BinName
ObjectTable:
objID
ObjectName < Unique
LinkTable:
wsID
binID
objID
The result of my query is:
WorkshopName / BinName / ObjectName
A / GA / Screw_1
A / GA / Screw_2
A / GB / Nut_2
B / GA / Bolt_9
B / GM / Screw_12
Each workshop has to have a unique name, and the Unique property in the
Workshop Table enforces that.
How can I restructure the tables so that the database automatically
generates an error for duplicate bin names in a Workshop, but allows
duplicate Bin names if the workshop is not the same - I can't set BinName to
unique (example Bin GA exists in both workshop A and B, but I want to make
sure that the user doesn't generate 2 bins called "GA" in the same workshop)
The unique identifier would be the pair WorkshopName/Bin name, but I can't
see how to enforce that at table level.
Can Access do this?
Thanks for any help,
James