A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

duplicate table values



 
 
Thread Tools Display Modes
  #1  
Old April 24th, 2008, 07:39 PM posted to microsoft.public.access.tablesdbdesign
mkarmali
external usenet poster
 
Posts: 5
Default 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  
Old April 24th, 2008, 09:14 PM posted to microsoft.public.access.tablesdbdesign
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default 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  
Old April 25th, 2008, 01:25 PM posted to microsoft.public.access.tablesdbdesign
TedMi
external usenet poster
 
Posts: 507
Default duplicate table values

Are you SURE you won't ever get two John Smiths?
--
TedMi

  #4  
Old April 26th, 2008, 03:30 PM posted to microsoft.public.access.tablesdbdesign
Evi
external usenet poster
 
Posts: 898
Default 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  
Old April 26th, 2008, 09:51 PM posted to microsoft.public.access.tablesdbdesign
mkarmali
external usenet poster
 
Posts: 5
Default 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  
Old April 26th, 2008, 09:52 PM posted to microsoft.public.access.tablesdbdesign
mkarmali
external usenet poster
 
Posts: 5
Default duplicate table values

thanks!

"tedmi" wrote:

Are you SURE you won't ever get two John Smiths?
--
TedMi

  #7  
Old April 26th, 2008, 09:53 PM posted to microsoft.public.access.tablesdbdesign
mkarmali
external usenet poster
 
Posts: 5
Default 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  
Old January 11th, 2009, 12:48 AM posted to microsoft.public.access.tablesdbdesign
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:00 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.