Preventing Duplicates

gtcoglan

Registered User.
Local time
Today, 21:46
Joined
Jun 9, 2005
Messages
13
Hi,

I have a form and within that form there is two combo boxes and one text box. When one choses a value from one combo box, and then chooses a value for the other combo box and then enters the value into the textbox I don't want the user to be able to enter the same arrangement. That is I want to prevent duplicates on that combination. Also if they do this I want a Message Box to appear saying that that this combination already exists

I was thinking of using a multiple field index to prevent the duplicates, but I don't know if this is a wise thing to do. Can someone give me some help to see how I can prevent duplicates or offer another solution to prevent duplicates on the combination of the values.

Thanks
Greg
 
Hi Greg

I'm not sure what you mean by 'multiple field index' but one way of preventing duplicate entries is in your table design - select multiple fields and click the 'key' symbol. This might be what you mean when you refer to a 'multiple field index' - I have also seen it referred to as a 'joint primary key' - no doubt there are many other names for this.

The fields combined must have a unique value, but each field individually can have repeating values. I'm not sure how well that method is supported on this forum but it is a technique I use frequently for exactly the reasons you posted. If I have described a 'multiple field index' correctly, I'm curious as to why don't you think it is wise thing to do.

Andrew :)
 
I'd recommend you set up a multi-field index (with no duplicates) over the three fields you have, but don't make that your primary key.

Dave
 

Users who are viewing this thread

Back
Top Bottom