Preventing duplicates

waka

Registered User.
Local time
Yesterday, 16:03
Joined
Jul 15, 2009
Messages
20
I have a database that links individual trees to a plot. The tree table has a tree_number field that contains a numeric tag number. I'm trying to figure out a way to restrict the tag number so that duplicate numbers can not be entered in the same plot. Is this possible?

Thanks!
 
Sure. I would create a compound index on the two fields for the plot and tag number that is set to no dups allowed.
 
You will have to create an indexed (no duplicates) field in the plot table that contains a combination of treeID and PlotID.
You can't use Autonumber for this obviously, so you'll have to use code to create this compound-key.

It may look something like this "1234_0012" where 1234 is the Tree ID and 0012 is the Plot ID (or vis-versa)

Ah, beat me to it.
 
But wait, let me ask you this;

Can a single tree be in two plots at once? ever?
 

Users who are viewing this thread

Back
Top Bottom