Aussie John Posted June 29, 2004 Posted June 29, 2004 I want to change the relationship in a file. it means creating new fiels in both the parent and child records. Does anyone know of an automatic way to get the related files to take on the the new related ID? thanks
MoonShadow Posted June 29, 2004 Posted June 29, 2004 You will use your existing relationship, John. 1) Create a field in Main called TempID and reserialize your existing table using this field. Be sure to show all records first. Relationships (in 7) work both directions so that is all you will need (skip to 2). For < 7, you would need a reverse relationship to connect your related MainID back to Main MainID. 2) Create a field (TempID) in your related to hold your new MainID then use a looping Set Field (or Replace Contents) as: Set Field [ Related::TempID; Main::TempID ] Once correct (you can check it be creating a temp relationship on these temp fields) and checking the results, run through both files, setting the ID with the temp. Always back up first regardless. And be sure to reset your Auto-Enter next serial values. If planned for, this will be a rarity; however, sometimes you will convert a solution with improper IDs and knowing how to reassign keys is valuable.
Recommended Posts
This topic is 7509 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now