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  

relationships



 
 
Thread Tools Display Modes
  #1  
Old July 25th, 2008, 12:01 PM posted to microsoft.public.access.tablesdbdesign
Mutya
external usenet poster
 
Posts: 1
Default relationships

This is probably a stupid question but pls indulge me. Can you still define
relationships after the tables have been populated? I think I wasn't paying
close attention when I designed my database. Now I realise that I need to
build new relationships and delete others. Could I still do this when the
fields are no longer empty?

Thanks.

Mutya
  #2  
Old July 25th, 2008, 01:16 PM posted to microsoft.public.access.tablesdbdesign
Fred
external usenet poster
 
Posts: 1,451
Default relationships

Yes you can.

Of course, certain things that you already put in there / did may cause
issues with creation of joins. For example, certain joins require the there
be no duplicated values in the field that is a part of the join, and if
you've already entered duplicated values in that field, that will cause an
issue.





"Mutya" wrote:

This is probably a stupid question but pls indulge me. Can you still define
relationships after the tables have been populated? I think I wasn't paying
close attention when I designed my database. Now I realise that I need to
build new relationships and delete others. Could I still do this when the
fields are no longer empty?

Thanks.

Mutya

  #3  
Old July 27th, 2008, 03:02 AM posted to microsoft.public.access.tablesdbdesign
John W. Vinson/MVP
external usenet poster
 
Posts: 325
Default relationships

On Fri, 25 Jul 2008 04:01:00 -0700, Mutya
wrote:

This is probably a stupid question but pls indulge me. Can you still define
relationships after the tables have been populated? I think I wasn't paying
close attention when I designed my database. Now I realise that I need to
build new relationships and delete others. Could I still do this when the
fields are no longer empty?


You may well need to edit some of the records in the table, if there
are records which would violate the relationship.

Let's say you have a classic school enrollment application with a
table of Classes, a table of Students, and a table of Enrollment; the
latter would be related one-to-many to Classes by ClassID, and to
Students by StudentID.

If you created and filled the tables with no relationships enforced,
you might well have a record in Enrollment with ClassID 1 and
StudentID 1254 - despite the fact that there is no student with
StudentID 1254, and no record in the Students table with that ID.
Should that be the case, Access won't let you create the relationship!

The solution is to find this bad record, and either delete it, or
correct the StudentID to 125 (the actual ID of the student enrolled in
Class 1). Naturally this process may be a bit difficult if you don't
know what the data should have been, reinforcing the benefits of
maintaining integrity in the first place!

--

John W. Vinson/MVP
 




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 03:44 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.