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  

Relationship Question



 
 
Thread Tools Display Modes
  #1  
Old December 2nd, 2009, 04:17 AM posted to microsoft.public.access.tablesdbdesign
Steve Haack
external usenet poster
 
Posts: 52
Default Relationship Question

I have a field called tblPeople. It has an AutoNumber field as its PK, it has
a field called ID which is a text field, indexed (no dupes).

I have another table called tblEvents. In tblEvents I have amongst others,
two fields, Manager and Director. I am trying to create relationships between
tblEvents.Manager and tblPeople.ID, and also between tblEvents.Director and
tblPeople.ID. I have done that.

What I can't do though, is set Referential Integrity with Cascading Updates
so that if a person's ID changes (which it can, since it is an ID Badge
Number) it updates the records in tblEvents.

Any ideas?
  #2  
Old December 2nd, 2009, 04:53 AM posted to microsoft.public.access.tablesdbdesign
Gina Whipp
external usenet poster
 
Posts: 3,500
Default Relationship Question

Steve,

Ummm, do you get a message? What happens when you try?

I'm going to make a suggestion here... I would have set up the table
differently...

tblPeople
pPeopleID (PK - Autonumber)
pBadgeID (Set to no duplicates but I can change when I like)

tblEvents
eEventID (PK)
eDirector (FK-linked to pPeopleID)
eManager (FK-linked to pPeopleID)

The above way allows you to set Referential Integrity without worrying about
Cascading Updates. A Primary Key should be used to relate records and you
should not care what it is. Okay, enough with my two cents worth!

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"Steve Haack" wrote in message
...
I have a field called tblPeople. It has an AutoNumber field as its PK, it
has
a field called ID which is a text field, indexed (no dupes).

I have another table called tblEvents. In tblEvents I have amongst others,
two fields, Manager and Director. I am trying to create relationships
between
tblEvents.Manager and tblPeople.ID, and also between tblEvents.Director
and
tblPeople.ID. I have done that.

What I can't do though, is set Referential Integrity with Cascading
Updates
so that if a person's ID changes (which it can, since it is an ID Badge
Number) it updates the records in tblEvents.

Any ideas?



  #3  
Old December 2nd, 2009, 04:53 AM posted to microsoft.public.access.tablesdbdesign
Gina Whipp
external usenet poster
 
Posts: 3,500
Default Relationship Question

Steve,

Ummm, do you get a message? What happens when you try?

I'm going to make a suggestion here... I would have set up the table
differently...

tblPeople
pPeopleID (PK - Autonumber)
pBadgeID (Set to no duplicates but I can change when I like)

tblEvents
eEventID (PK)
eDirector (FK-linked to pPeopleID)
eManager (FK-linked to pPeopleID)

The above way allows you to set Referential Integrity without worrying about
Cascading Updates. A Primary Key should be used to relate records and you
should not care what it is. Okay, enough with my two cents worth!

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"Steve Haack" wrote in message
...
I have a field called tblPeople. It has an AutoNumber field as its PK, it
has
a field called ID which is a text field, indexed (no dupes).

I have another table called tblEvents. In tblEvents I have amongst others,
two fields, Manager and Director. I am trying to create relationships
between
tblEvents.Manager and tblPeople.ID, and also between tblEvents.Director
and
tblPeople.ID. I have done that.

What I can't do though, is set Referential Integrity with Cascading
Updates
so that if a person's ID changes (which it can, since it is an ID Badge
Number) it updates the records in tblEvents.

Any ideas?



  #4  
Old December 2nd, 2009, 04:53 AM posted to microsoft.public.access.tablesdbdesign
Gina Whipp
external usenet poster
 
Posts: 3,500
Default Relationship Question

Steve,

Ummm, do you get a message? What happens when you try?

I'm going to make a suggestion here... I would have set up the table
differently...

tblPeople
pPeopleID (PK - Autonumber)
pBadgeID (Set to no duplicates but I can change when I like)

tblEvents
eEventID (PK)
eDirector (FK-linked to pPeopleID)
eManager (FK-linked to pPeopleID)

The above way allows you to set Referential Integrity without worrying about
Cascading Updates. A Primary Key should be used to relate records and you
should not care what it is. Okay, enough with my two cents worth!

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"Steve Haack" wrote in message
...
I have a field called tblPeople. It has an AutoNumber field as its PK, it
has
a field called ID which is a text field, indexed (no dupes).

I have another table called tblEvents. In tblEvents I have amongst others,
two fields, Manager and Director. I am trying to create relationships
between
tblEvents.Manager and tblPeople.ID, and also between tblEvents.Director
and
tblPeople.ID. I have done that.

What I can't do though, is set Referential Integrity with Cascading
Updates
so that if a person's ID changes (which it can, since it is an ID Badge
Number) it updates the records in tblEvents.

Any ideas?



  #5  
Old December 2nd, 2009, 07:59 AM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Relationship Question

On Tue, 1 Dec 2009 19:17:01 -0800, Steve Haack
wrote:

I have a field called tblPeople. It has an AutoNumber field as its PK, it has
a field called ID which is a text field, indexed (no dupes).

I have another table called tblEvents. In tblEvents I have amongst others,
two fields, Manager and Director. I am trying to create relationships between
tblEvents.Manager and tblPeople.ID, and also between tblEvents.Director and
tblPeople.ID. I have done that.

What I can't do though, is set Referential Integrity with Cascading Updates
so that if a person's ID changes (which it can, since it is an ID Badge
Number) it updates the records in tblEvents.

Any ideas?


Gina's advice is probably your best solution, but as an alternative, you might
want to consider something that some people would consider heretical: get rid
of the tblPeople autonumber altogether, and make ID the Primary Key. I believe
that Cascade Update applies only to the Primary Key field, not to other
uniquely indexed fields.
--

John W. Vinson [MVP]
  #6  
Old December 2nd, 2009, 07:59 AM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Relationship Question

On Tue, 1 Dec 2009 19:17:01 -0800, Steve Haack
wrote:

I have a field called tblPeople. It has an AutoNumber field as its PK, it has
a field called ID which is a text field, indexed (no dupes).

I have another table called tblEvents. In tblEvents I have amongst others,
two fields, Manager and Director. I am trying to create relationships between
tblEvents.Manager and tblPeople.ID, and also between tblEvents.Director and
tblPeople.ID. I have done that.

What I can't do though, is set Referential Integrity with Cascading Updates
so that if a person's ID changes (which it can, since it is an ID Badge
Number) it updates the records in tblEvents.

Any ideas?


Gina's advice is probably your best solution, but as an alternative, you might
want to consider something that some people would consider heretical: get rid
of the tblPeople autonumber altogether, and make ID the Primary Key. I believe
that Cascade Update applies only to the Primary Key field, not to other
uniquely indexed fields.
--

John W. Vinson [MVP]
  #7  
Old December 2nd, 2009, 07:59 AM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Relationship Question

On Tue, 1 Dec 2009 19:17:01 -0800, Steve Haack
wrote:

I have a field called tblPeople. It has an AutoNumber field as its PK, it has
a field called ID which is a text field, indexed (no dupes).

I have another table called tblEvents. In tblEvents I have amongst others,
two fields, Manager and Director. I am trying to create relationships between
tblEvents.Manager and tblPeople.ID, and also between tblEvents.Director and
tblPeople.ID. I have done that.

What I can't do though, is set Referential Integrity with Cascading Updates
so that if a person's ID changes (which it can, since it is an ID Badge
Number) it updates the records in tblEvents.

Any ideas?


Gina's advice is probably your best solution, but as an alternative, you might
want to consider something that some people would consider heretical: get rid
of the tblPeople autonumber altogether, and make ID the Primary Key. I believe
that Cascade Update applies only to the Primary Key field, not to other
uniquely indexed fields.
--

John W. Vinson [MVP]
  #8  
Old December 3rd, 2009, 03:12 PM posted to microsoft.public.access.tablesdbdesign
Steve Haack
external usenet poster
 
Posts: 52
Default Relationship Question

Gina,
Thanks for the reply and information. The message that I get is: "Access
can't enforce the referential integrity for this relationship. Make sure the
fields you drag are PK fields or uniquely indexed and that the unique index
or PK is correctly set."

The thing is, I have tblPeople linked to another table on the ID field (but
only on link, not two) and it works perfectly.

I am going to look into your suggestion to see if that will work.

Thanks,
Steve

"Gina Whipp" wrote:

Steve,

Ummm, do you get a message? What happens when you try?

I'm going to make a suggestion here... I would have set up the table
differently...

tblPeople
pPeopleID (PK - Autonumber)
pBadgeID (Set to no duplicates but I can change when I like)

tblEvents
eEventID (PK)
eDirector (FK-linked to pPeopleID)
eManager (FK-linked to pPeopleID)

The above way allows you to set Referential Integrity without worrying about
Cascading Updates. A Primary Key should be used to relate records and you
should not care what it is. Okay, enough with my two cents worth!

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"Steve Haack" wrote in message
...
I have a field called tblPeople. It has an AutoNumber field as its PK, it
has
a field called ID which is a text field, indexed (no dupes).

I have another table called tblEvents. In tblEvents I have amongst others,
two fields, Manager and Director. I am trying to create relationships
between
tblEvents.Manager and tblPeople.ID, and also between tblEvents.Director
and
tblPeople.ID. I have done that.

What I can't do though, is set Referential Integrity with Cascading
Updates
so that if a person's ID changes (which it can, since it is an ID Badge
Number) it updates the records in tblEvents.

Any ideas?



.

  #9  
Old December 3rd, 2009, 03:17 PM posted to microsoft.public.access.tablesdbdesign
Steve Haack
external usenet poster
 
Posts: 52
Default Relationship Question

Gina,
Can you tell me what you mean by FK?

"Gina Whipp" wrote:

Steve,

Ummm, do you get a message? What happens when you try?

I'm going to make a suggestion here... I would have set up the table
differently...

tblPeople
pPeopleID (PK - Autonumber)
pBadgeID (Set to no duplicates but I can change when I like)

tblEvents
eEventID (PK)
eDirector (FK-linked to pPeopleID)
eManager (FK-linked to pPeopleID)

The above way allows you to set Referential Integrity without worrying about
Cascading Updates. A Primary Key should be used to relate records and you
should not care what it is. Okay, enough with my two cents worth!

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"Steve Haack" wrote in message
...
I have a field called tblPeople. It has an AutoNumber field as its PK, it
has
a field called ID which is a text field, indexed (no dupes).

I have another table called tblEvents. In tblEvents I have amongst others,
two fields, Manager and Director. I am trying to create relationships
between
tblEvents.Manager and tblPeople.ID, and also between tblEvents.Director
and
tblPeople.ID. I have done that.

What I can't do though, is set Referential Integrity with Cascading
Updates
so that if a person's ID changes (which it can, since it is an ID Badge
Number) it updates the records in tblEvents.

Any ideas?



.

  #10  
Old December 3rd, 2009, 05:34 PM posted to microsoft.public.access.tablesdbdesign
Gina Whipp
external usenet poster
 
Posts: 3,500
Default Relationship Question

Steve,

Add the table a second time to the Relationships window.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"Steve Haack" wrote in message
...
Gina,
Thanks for the reply and information. The message that I get is: "Access
can't enforce the referential integrity for this relationship. Make sure
the
fields you drag are PK fields or uniquely indexed and that the unique
index
or PK is correctly set."

The thing is, I have tblPeople linked to another table on the ID field
(but
only on link, not two) and it works perfectly.

I am going to look into your suggestion to see if that will work.

Thanks,
Steve

"Gina Whipp" wrote:

Steve,

Ummm, do you get a message? What happens when you try?

I'm going to make a suggestion here... I would have set up the table
differently...

tblPeople
pPeopleID (PK - Autonumber)
pBadgeID (Set to no duplicates but I can change when I like)

tblEvents
eEventID (PK)
eDirector (FK-linked to pPeopleID)
eManager (FK-linked to pPeopleID)

The above way allows you to set Referential Integrity without worrying
about
Cascading Updates. A Primary Key should be used to relate records and
you
should not care what it is. Okay, enough with my two cents worth!

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"Steve Haack" wrote in message
...
I have a field called tblPeople. It has an AutoNumber field as its PK,
it
has
a field called ID which is a text field, indexed (no dupes).

I have another table called tblEvents. In tblEvents I have amongst
others,
two fields, Manager and Director. I am trying to create relationships
between
tblEvents.Manager and tblPeople.ID, and also between tblEvents.Director
and
tblPeople.ID. I have done that.

What I can't do though, is set Referential Integrity with Cascading
Updates
so that if a person's ID changes (which it can, since it is an ID Badge
Number) it updates the records in tblEvents.

Any ideas?



.



 




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 08:39 AM.


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