By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,234 Members | 1,832 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,234 IT Pros & Developers. It's quick & easy.

Two Field Integrity

P: n/a
G'day All,

I am working on something, and wonder if I am approaching it
correctly....

3 Tables...........

ProductTable
ProductID - PK

StockLocationTable
StockLocationID - PK

StockTakeLineTable
StockTakeLineID - PK
StockTakeID - FK
ProductID - FK
StockLocationID - FK
What is the best way to enforce that in the StockTake Table, their is
no identical records with the same (ProductID & Stocklocation) -
giving effectively a duplicate input record.

Currently, I am trying to test while inputing into the subform, but it
does get difficult to know you are covering all bases.

Now and then, I check and find the same record has been inadertently
typed in. I think it may have been some whacker pressing the page
down key accidently on the form, which is fixed now. But perhaps
there is other holes?
Thanks in advance to any contributors!

Elias Farah.
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Elias Farah" <lo******@hotmail.com> wrote in message
news:c6**************************@posting.google.c om...
G'day All,

I am working on something, and wonder if I am approaching it
correctly....

3 Tables...........

ProductTable
ProductID - PK

StockLocationTable
StockLocationID - PK

StockTakeLineTable
StockTakeLineID - PK
StockTakeID - FK
ProductID - FK
StockLocationID - FK
What is the best way to enforce that in the StockTake Table, their is
no identical records with the same (ProductID & Stocklocation) -
giving effectively a duplicate input record.

Currently, I am trying to test while inputing into the subform, but it
does get difficult to know you are covering all bases.

Now and then, I check and find the same record has been inadertently
typed in. I think it may have been some whacker pressing the page
down key accidently on the form, which is fixed now. But perhaps
there is other holes?


You can create a unique index consisting of those two fields and then the
database engine will enforce the rule.
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.