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 » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Creating Relationships



 
 
Thread Tools Display Modes
  #1  
Old February 15th, 2006, 08:39 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Creating Relationships

I am trying to create a one to many relationship between two tables and I
keep getting this message that reads "no unique index found for the
referenced field of the primary table" and I can not create the relationship.
What is causing this error message to come up?
  #2  
Old February 15th, 2006, 08:54 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Creating Relationships

Open the table in design view and look in the column to the left of the field
name that you say is your primary key. Is there an icon there that looks
like a key?

If there is not key then it is not set as the primary key. Click on the
toolbar icon that looks like a key and save.

If you get an error message saying you have duplicate then run a query to
find the duplicate and delete as necessary so as to be able to set your
primary key.


"vgarr" wrote:

I am trying to create a one to many relationship between two tables and I
keep getting this message that reads "no unique index found for the
referenced field of the primary table" and I can not create the relationship.
What is causing this error message to come up?

  #3  
Old February 15th, 2006, 09:17 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Creating Relationships

I have a primary in my tblCalLog table set as a autonumber and in my tblID
the primary key is set as text - can this be the problem?

"KARL DEWEY" wrote:

Open the table in design view and look in the column to the left of the field
name that you say is your primary key. Is there an icon there that looks
like a key?

If there is not key then it is not set as the primary key. Click on the
toolbar icon that looks like a key and save.

If you get an error message saying you have duplicate then run a query to
find the duplicate and delete as necessary so as to be able to set your
primary key.


"vgarr" wrote:

I am trying to create a one to many relationship between two tables and I
keep getting this message that reads "no unique index found for the
referenced field of the primary table" and I can not create the relationship.
What is causing this error message to come up?

  #4  
Old February 15th, 2006, 09:20 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Creating Relationships

On Wed, 15 Feb 2006 12:39:31 -0800, "vgarr"
wrote:

I am trying to create a one to many relationship between two tables and I
keep getting this message that reads "no unique index found for the
referenced field of the primary table" and I can not create the relationship.
What is causing this error message to come up?


The fact that you do not have a unique Index (such as a Primary Key)
on the field in the "one" side table that you're using to create the
relationship.

Either make that field the Primary Key by opening the table in design
view, selecting the field, and clicking the "key" icon; or (if you
need to join on a field other than the primary key) set that field's
Index property to a unique index.


John W. Vinson[MVP]
  #5  
Old February 15th, 2006, 09:21 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Creating Relationships

That shouldn't matter, as long as the foreign key in the child table has the
same type as the primary key in the parent table (if the PK is an
AutoNumber, then the FK should be a Long Integer)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"vgarr" wrote in message
...
I have a primary in my tblCalLog table set as a autonumber and in my tblID
the primary key is set as text - can this be the problem?

"KARL DEWEY" wrote:

Open the table in design view and look in the column to the left of the

field
name that you say is your primary key. Is there an icon there that

looks
like a key?

If there is not key then it is not set as the primary key. Click on the
toolbar icon that looks like a key and save.

If you get an error message saying you have duplicate then run a query

to
find the duplicate and delete as necessary so as to be able to set your
primary key.


"vgarr" wrote:

I am trying to create a one to many relationship between two tables

and I
keep getting this message that reads "no unique index found for the
referenced field of the primary table" and I can not create the

relationship.
What is causing this error message to come up?



  #6  
Old February 15th, 2006, 09:51 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Creating Relationships

It only says one to one, how do I change it to one to many?

"John Vinson" wrote:

On Wed, 15 Feb 2006 12:39:31 -0800, "vgarr"
wrote:

I am trying to create a one to many relationship between two tables and I
keep getting this message that reads "no unique index found for the
referenced field of the primary table" and I can not create the relationship.
What is causing this error message to come up?


The fact that you do not have a unique Index (such as a Primary Key)
on the field in the "one" side table that you're using to create the
relationship.

Either make that field the Primary Key by opening the table in design
view, selecting the field, and clicking the "key" icon; or (if you
need to join on a field other than the primary key) set that field's
Index property to a unique index.


John W. Vinson[MVP]

  #7  
Old February 15th, 2006, 10:44 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Creating Relationships

You should only get a one-to-one if you've declared the field to be a
primary key in both tables.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"vgarr" wrote in message
...
It only says one to one, how do I change it to one to many?

"John Vinson" wrote:

On Wed, 15 Feb 2006 12:39:31 -0800, "vgarr"
wrote:

I am trying to create a one to many relationship between two tables and
I
keep getting this message that reads "no unique index found for the
referenced field of the primary table" and I can not create the
relationship.
What is causing this error message to come up?


The fact that you do not have a unique Index (such as a Primary Key)
on the field in the "one" side table that you're using to create the
relationship.

Either make that field the Primary Key by opening the table in design
view, selecting the field, and clicking the "key" icon; or (if you
need to join on a field other than the primary key) set that field's
Index property to a unique index.


John W. Vinson[MVP]



  #8  
Old February 15th, 2006, 11:26 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Creating Relationships

On Wed, 15 Feb 2006 13:51:27 -0800, "vgarr"
wrote:

It only says one to one, how do I change it to one to many?


Sounds like you're trying to link the Primary Key of the one table to
the Primary Key of the other - don't!

The "many" side table should contain its own Primary Key, and - as a
separate field - a Long Integer field which will serve as the foreign
key, linked to the Autonumber primary key of the parent table.

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
deleting relationships PattiP Database Design 4 February 24th, 2006 08:21 PM
Database Split Without taking my relationships to the BE GAB New Users 2 January 24th, 2006 05:59 PM
Creating Stationary with pictures Amy General Discussion 0 October 5th, 2005 10:10 PM
Setting Table Relationships- Why? el zorro Database Design 4 November 8th, 2004 10:29 PM
Disappearing relationships Dan Database Design 2 August 6th, 2004 06:43 AM


All times are GMT +1. The time now is 08:11 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.