Newbie - help with validation rules

  • Thread starter Thread starter Spidey3721
  • Start date Start date
S

Spidey3721

Hello - newbie here.

I have two tables - One that is a master category list for cost codes
(example: CodeID=0002 CodeDescr=Drywall subcontract)

My second table is for each project, where I would like to be able to enter
in a specific cost amount for each cost code (example CostID=1, CodeID=0002,
Cost=$415,000).

I am stuck trying to limit the user from only entering one cost for each
cost code that exists in the master list.
 
Hello - newbie here.

I have two tables - One that is a master category list for cost codes
(example: CodeID=0002 CodeDescr=Drywall subcontract)

My second table is for each project, where I would like to be able to enter
in a specific cost amount for each cost code (example CostID=1, CodeID=0002,
Cost=$415,000).

I am stuck trying to limit the user from only entering one cost for each
cost code that exists in the master list.

Open the Relationships window and create a relationship between the
two tables joining them on CodeID, and check the "Enforce Relational
Integrity" checkbox. If you want one and only one cost for each
CodeID, you can make the CostID field unique by setting a unique Index
on it - but you might instead just do away with this second table
altogether, and simply put CostID into the master list as a foreign
key.
 
Actually - I want only one cost aloowed for each category PER PROJECT. This
might change things up a bit.


I have two tables - One that is a master category list for cost codes
(example: CodeID=0002 CodeDescr=Drywall subcontract)

My second table is for each project, where I would like to be able to enter
in a specific cost amount for each cost code (example ProjectID=256724
(foreign key to master job table), CostID=1, CodeID=0002,
Cost=$415,000).
 
Actually - I want only one cost aloowed for each category PER PROJECT. This
might change things up a bit.


I have two tables - One that is a master category list for cost codes
(example: CodeID=0002 CodeDescr=Drywall subcontract)

My second table is for each project, where I would like to be able to enter
in a specific cost amount for each cost code (example ProjectID=256724
(foreign key to master job table), CostID=1, CodeID=0002,
Cost=$415,000).

It sounds like you could make CostID and ProjectID a joint Primary Key
of this table, or else create a unique Index on these two fields.
 
Back
Top