error msg when try to create 1 to many relationship

  • Thread starter Thread starter areimer23
  • Start date Start date
A

areimer23

When I click on the referential integrity box this error msg pops up:
"Relationship must be on the same number of fields with the same data types."

what does this mean?
 
If you are trying to show a relationship between two tables, the field(s) by
which you connect them must be the same data types (e.g., "Text" doesn't
connect with "Number").

If you use more than one field to connect, you must use the same number of
fields (and with the corresponding data types) in both tables.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
I have an Issues table with a field "Driving School." I want to link that
field with a separate table showing address information for the driving
schools which has a primary key "Policy Number".
In the Issues table, the row source I have for this "driving school" column
is
SELECT [Company Name] FROM [Driving Schools] ORDER BY [Company Name]

would this affect me creating referential integrity and is there a way to
correct the problem without having to show the Policy number in the Issues
table?
does that make sense?
 
I'm having trouble following...

What are you storing in [Driving School] in tblIssues? Is it a number? Is
it the name of the driving school? Is it a Yes/No field?

What does [Policy Number] have to do with [Driving School]?

Where does [Company Name] come into this?

What is [Driving Schools]? Is that a table? A mis-spelling of the field
named [Driving School]?

More info, please!


Regards

Jeff Boyce
Microsoft Office/Access MVP

areimer23 said:
I have an Issues table with a field "Driving School." I want to link that
field with a separate table showing address information for the driving
schools which has a primary key "Policy Number".
In the Issues table, the row source I have for this "driving school"
column
is
SELECT [Company Name] FROM [Driving Schools] ORDER BY [Company Name]

would this affect me creating referential integrity and is there a way to
correct the problem without having to show the Policy number in the Issues
table?
does that make sense?

Jeff Boyce said:
If you are trying to show a relationship between two tables, the field(s)
by
which you connect them must be the same data types (e.g., "Text" doesn't
connect with "Number").

If you use more than one field to connect, you must use the same number
of
fields (and with the corresponding data types) in both tables.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
in tblIssues - field is [Driving School]
in tbl Driving Schools
- [Policy ID] - primary key
- [Company Name]
- [address]
- [phone number]

The row source for [Driving School] field in Issues is listed below so that
the [Company Name] of the Driving school is displayed. This data is pulled
from a separate table [Driving Schools]. I'm with an insurance company and
[policy ID] is the Driving Schools unique identifier.
I want the number under primary key [Policy ID] to match with the name
displayed in Issues

Jeff Boyce said:
I'm having trouble following...

What are you storing in [Driving School] in tblIssues? Is it a number? Is
it the name of the driving school? Is it a Yes/No field?

What does [Policy Number] have to do with [Driving School]?

Where does [Company Name] come into this?

What is [Driving Schools]? Is that a table? A mis-spelling of the field
named [Driving School]?

More info, please!


Regards

Jeff Boyce
Microsoft Office/Access MVP

areimer23 said:
I have an Issues table with a field "Driving School." I want to link that
field with a separate table showing address information for the driving
schools which has a primary key "Policy Number".
In the Issues table, the row source I have for this "driving school"
column
is
SELECT [Company Name] FROM [Driving Schools] ORDER BY [Company Name]

would this affect me creating referential integrity and is there a way to
correct the problem without having to show the Policy number in the Issues
table?
does that make sense?

Jeff Boyce said:
If you are trying to show a relationship between two tables, the field(s)
by
which you connect them must be the same data types (e.g., "Text" doesn't
connect with "Number").

If you use more than one field to connect, you must use the same number
of
fields (and with the corresponding data types) in both tables.

Regards

Jeff Boyce
Microsoft Office/Access MVP

When I click on the referential integrity box this error msg pops up:
"Relationship must be on the same number of fields with the same data
types."

what does this mean?
 
I'll return to your original post concerning the error message.

Are the fields on which you wish to establish referential integrity
identical data types? Are there the same number of fields on both "sides"
of the relationship?

If your tables already have data in them, there's a chance that some of that
data violates the rules of referential integrity, thus preventing you from
establishing it until the records are cleaned up. One example of how this
might happen is if your "many" side table has foreign keys that are NOT
present in the "one" side table.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP

areimer23 said:
in tblIssues - field is [Driving School]
in tbl Driving Schools
- [Policy ID] - primary key
- [Company Name]
- [address]
- [phone number]

The row source for [Driving School] field in Issues is listed below so
that
the [Company Name] of the Driving school is displayed. This data is
pulled
from a separate table [Driving Schools]. I'm with an insurance company
and
[policy ID] is the Driving Schools unique identifier.
I want the number under primary key [Policy ID] to match with the name
displayed in Issues

Jeff Boyce said:
I'm having trouble following...

What are you storing in [Driving School] in tblIssues? Is it a number?
Is
it the name of the driving school? Is it a Yes/No field?

What does [Policy Number] have to do with [Driving School]?

Where does [Company Name] come into this?

What is [Driving Schools]? Is that a table? A mis-spelling of the field
named [Driving School]?

More info, please!


Regards

Jeff Boyce
Microsoft Office/Access MVP

areimer23 said:
I have an Issues table with a field "Driving School." I want to link
that
field with a separate table showing address information for the driving
schools which has a primary key "Policy Number".
In the Issues table, the row source I have for this "driving school"
column
is
SELECT [Company Name] FROM [Driving Schools] ORDER BY [Company Name]

would this affect me creating referential integrity and is there a way
to
correct the problem without having to show the Policy number in the
Issues
table?
does that make sense?

:

If you are trying to show a relationship between two tables, the
field(s)
by
which you connect them must be the same data types (e.g., "Text"
doesn't
connect with "Number").

If you use more than one field to connect, you must use the same
number
of
fields (and with the corresponding data types) in both tables.

Regards

Jeff Boyce
Microsoft Office/Access MVP

When I click on the referential integrity box this error msg pops
up:
"Relationship must be on the same number of fields with the same
data
types."

what does this mean?
 
Back
Top