Hi
I have a SQL database linked to an Access front end which has (amongst others) the following fields:
ID
LastName
FirstName
zipCode
emailaddress
ID is the primary key and indexed (no duplicates)
The others are varchar text fields.
I would like to do two things
1. Prevent a duplicate email address being entered in the emailaddress field and if the entry then passes that test to
2. Prevent a contact being added if they have the same firstname, lastname and zipcode as somebody (probably them) already in the database.
I can not do 1. by making the emailaddress field indexed no duplicates because there are nulls in the emailaddress field which SQL or access treates as a duplicate.
So it needs a trigger I think. Can any body give me the code or point me in the write direction?
Thanks
pj
I have a SQL database linked to an Access front end which has (amongst others) the following fields:
ID
LastName
FirstName
zipCode
emailaddress
ID is the primary key and indexed (no duplicates)
The others are varchar text fields.
I would like to do two things
1. Prevent a duplicate email address being entered in the emailaddress field and if the entry then passes that test to
2. Prevent a contact being added if they have the same firstname, lastname and zipcode as somebody (probably them) already in the database.
I can not do 1. by making the emailaddress field indexed no duplicates because there are nulls in the emailaddress field which SQL or access treates as a duplicate.
So it needs a trigger I think. Can any body give me the code or point me in the write direction?
Thanks
pj