Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not Letting the user input a value that already exists..

Status
Not open for further replies.

PatrickB101

Programmer
Oct 4, 2001
22
US
Not Letting the user input a value that already exists..

I am not sure I have done sever vb programs nothing to do with database programs.. So bear with me. I understand i need to do this in a when validate item trigger.
do you know what the syntax for if item equals a item that already exist in the database then ... so on and so forth ?

regards,
Patrick
 
Hi.
Best way is to create a unique constraint on the column you want to be unique:
ALTER TABLE yourTable ADD CONSTRAINT key_name UNIQUE KEY (yourColumn)

Also works for a set of columns.

Stefan

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top