Hi Lee-Anne. You can use a compound index to prevent duplicates, but it
requires the right data structure.
You should have 3 tables:
Employee table:
EmployeeID primary key
Surname
FirstName etc
Skill table:
SkillID primary key
SkillName etc.
EmployeeSkill table:
EmployeeID foreign key to Employee.EmployeeID
SkillID foreign key to Skill.SkillID
The interface is then a main form bound to the Employee table, with a
subform bound to the EmployeeSkill table. In the subform you enter a for for
each skill the employee has, using a combo box bound to the Skill table.
If that's the way you are set up:
1. Open the EmployeeSkill table in design view.
2. Open the Indexes box (View menu).
3. Enter a name for a new index, and the EmployeeID field.
4. On the next row in the Indexes box, leave the Name column blank, and
choose the SkillID field. It will look something like this (possibly with
other indexes listed as well):
Index Name Field Name Sort Order
========= ========= =======
EmployeeIdSkillId EmployeeID Ascending
SkillID Ascending
5. Select the row with the index name (EmployeeIdSkillId), and in the lower
pane of the dialog, set the Unique property to Yes.
6. Save.
The index will now prevent you from entering duplicates of the combination
of EmployeeID + SkillID.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Lee-Anne Waters via AccessMonster.com" <fo***@AccessMonster.com> wrote in
message news:b9******************************@AccessMonste r.com...
Hello,
just a small problem i'm hoping someone would help me with.
i have a form which adds skills to a person but i want to make sure that
the skill is not entered twice.
is there anyway of preventing a duplicate skill from being entered. (i
cant set the table value to no duplicates as there are many skills listed
for many employee's and some of these would be the same)
thanks for your help
Lee-Anne