Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do I set cascade relationship between two tables? 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello, here is the problem that I am encountering. I am trying to use an append query to append records to a table called "visit". However, Access gave me a key violation error. I went ahead and made a copy of the "visit" table and run the append query on the copy. It works fine. Both tables have the same format and data. The only differnce between the two is that the copy doesn't have any relatioship w/ other tables.

Could the problem be possibly solve by setting cascade relationship ( I have no idea how to do that)? Please give me some light..thanks in advance.

 
Hi 8384,

to continue ;-)

from the database window the one that allows you to select the tables,queries,forms &etc right click on the gray area
this will bring up a menu select relationships.

a display form will pop up if you haven't already added tables to the relationships add these by right clicking and selecting tables.

to create a relationship between tables click on the master table field and drag this to the child tables field that you want to form the relationship on you will then be prompted to define the relationship type.

HTH

Robert Dwyer
rdwyer@orion-online.com.au
 
What you probably have is a table that has a "child" relationship to another table. I believe what's happening is a record is trying to be appended whose foreign key value doesn't have a matching primary key value in the parent table or this value is null. This will give you this type of error. You can find the offending record(s) by doing a make table query instead of an append query. Then use the UnMatched query wizard to find those records in the table you're importing that have no matching record in the parent table.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top