473,387 Members | 1,365 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Two Field Integrity

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
1 1356
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Jack | last post by:
Hi, This is a strange problem I am encountering. I have a asp page with a confirmation.asp page that saves data to a table. There are few text fields that are captured by the confirmation page as...
4
by: Omey Samaroo | last post by:
I am using Employee_Number as a primary field in one table and in another table I have a field with the same name that it references in a one to many relationship. How do I change the primary field...
3
by: Randy | last post by:
I have a MAIN database and a Detail database. They are linked by ID field. I have a case number in both databases and I want to be able to enter the case number in the MAIN database and when I...
14
by: Larry R Harrison Jr | last post by:
I have designed databases but have never come across any complications due to the ridiculous situation of a hyphenated last name. As a database designer (very junior level) I disdain anything...
4
by: MLH | last post by:
I have tblVehicles and tblOwners. The former has a field that is link to a unique owner in tblOwners. Trouble is, not every vehicle can be identified with an owner. So I want to be able to leave...
18
by: Dixie | last post by:
Can I set the Format property in a date/time field in code? Can I set the Input Mask in a date/time field in code? Can I set the Format of a Yes/No field to Checkbox in code? I am working on...
16
by: Brian Tkatch | last post by:
Is there a way to check the order in which SET INTEGRITY needs to be applied? This would be for a script with a dynamic list of TABLEs. B.
4
by: Don Do | last post by:
Help I built a form/subform/subsubform setup using the access forms wizard. I have a table1 = parent, table2 = child, table3 = (grandchild?). There will be multiple records in table2 that tie...
2
by: Richard Sherratt | last post by:
I've inherited a system that was designed by someone with no understanding of database design. From the logical design point of view, there is no logical design. The physical design is a nightmare....
6
by: Richard Penfold | last post by:
Can someone explain why a field on the many side of a one-to-many relationship, with referential integrity enforced, is not automatically updating? I have 5 tables in my database with the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.