If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
duplicate table values
Hello:
I have created an employee table with a primary key: employee_number. I also have two fields: Last_name and First_name. How can I avoid allowing people who enter data into the table to enter a person twice? i.e. the database will allow me to add a person (same first and last name) repeatedly as long as the key is different. Thank you. |
#2
|
|||
|
|||
duplicate table values
Create an index based on those two fields. Make it a unique index.
-- Jerry Whittle, Microsoft Access MVP Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder. "mkarmali" wrote: Hello: I have created an employee table with a primary key: employee_number. I also have two fields: Last_name and First_name. How can I avoid allowing people who enter data into the table to enter a person twice? i.e. the database will allow me to add a person (same first and last name) repeatedly as long as the key is different. Thank you. |
#3
|
|||
|
|||
duplicate table values
Are you SURE you won't ever get two John Smiths?
-- TedMi |
#4
|
|||
|
|||
duplicate table values
I hope that you have something else addition to the name fields to identify
your person, perhaps an email address, a date of birth or a number field so that you can have John Smith 1, John Smith 2. To create a Unique Index In table Design View, click the Index button. Type MyIndex in the first column. In the second column choose LastName Type nothing into the first column on the next row but choose FirstName Again, type nothing into the first column of the next row but choose any other field you want for your index. Click back on the first row of your index and in the first column. Under the index list, next to where it says Unique, choose Yes Evi "mkarmali" wrote in message ... Hello: I have created an employee table with a primary key: employee_number. I also have two fields: Last_name and First_name. How can I avoid allowing people who enter data into the table to enter a person twice? i.e. the database will allow me to add a person (same first and last name) repeatedly as long as the key is different. Thank you. |
#5
|
|||
|
|||
duplicate table values
Thank you very much
"Jerry Whittle" wrote: Create an index based on those two fields. Make it a unique index. -- Jerry Whittle, Microsoft Access MVP Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder. |
#6
|
|||
|
|||
duplicate table values
thanks!
"tedmi" wrote: Are you SURE you won't ever get two John Smiths? -- TedMi |
#7
|
|||
|
|||
duplicate table values
Thank you very much Evi. I much needed the detailed way you conveyed how to
create an index when you have two or more fields. "Evi" wrote: I hope that you have something else addition to the name fields to identify your person, perhaps an email address, a date of birth or a number field so that you can have John Smith 1, John Smith 2. To create a Unique Index In table Design View, click the Index button. Type MyIndex in the first column. In the second column choose LastName Type nothing into the first column on the next row but choose FirstName Again, type nothing into the first column of the next row but choose any other field you want for your index. Click back on the first row of your index and in the first column. Under the index list, next to where it says Unique, choose Yes Evi |
#8
|
|||
|
|||
duplicate table values
test
-- Jerry Whittle - MS Access MVP 2007 - 2009 Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder "Jerry Whittle" wrote: Create an index based on those two fields. Make it a unique index. -- Jerry Whittle, Microsoft Access MVP Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder. "mkarmali" wrote: Hello: I have created an employee table with a primary key: employee_number. I also have two fields: Last_name and First_name. How can I avoid allowing people who enter data into the table to enter a person twice? i.e. the database will allow me to add a person (same first and last name) repeatedly as long as the key is different. Thank you. |
Thread Tools | |
Display Modes | |
|
|