Jump to content
Server Maintenance This Week. ×

RENUMBERING FIELDS IN JOINED TABLES


Simon Hall

This topic is 975 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Good morning. I have two tables joined by a field called Visit, which is simply a chronological number. For one entry in the first table, there can be many entries in the second table. I would like to renumber the Visit field in the first table. How can I force FM to automatically renumber the Visit field in the second table?

Thanks

Link to comment
Share on other sites

t cannot be done "automatically". You must script this (or do it manually, step-by-step) - and do it very carefulIy. 

This is a type of action that should never be necessary. Your parent table (in fact, every table) should have an ID field containing a value that is both unique and permanent - usually an auto-entered serial number or a UUID. This field should be the match field in the relationship to the child table. I strongly recommend you switch your solution to this arrangement first. Then you will be able to renumber the parent's Visit field without affecting the child table at all.

 

Edited by comment
Link to comment
Share on other sites

Once you have populated the ID field in the parent table, define a new ParentID field in the child table. Place it on the layout of the child table. Show all records. Click into the ParentID field and select Records > Replace Field Contents… > Replace with calculated result:

YourParentTable::ID

Then you can switch the relationship to use these two fields instead of the Visit field (which is no longer needed in the child table).

Make sure to have a backup before you try this, as there is no undo if you make a mistake.

 

Link to comment
Share on other sites

This topic is 975 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.