These are not table IDs, they are record ID's. Why changing data in one portal affects data shown in another is not a question we can answer without knowing a lot more about your tables and how they are related and also how they are set up on layouts.
In order to have a portal, you must have at least one relationship between two table occurrences in Manage | Database | Relationships.
What do you have there? Which of these "boxes" (called table occurrences) are specified in layout and portal setups? (Show records from and Show related records from).
BTW, duplicating a record does not delete any info, but could easily result in a situation where the duplicated record no longer matches to the same related records and thus the portal is empty on the duplicated record.
There are multiple layouts. The main layout is called "survey". It is connected to another layout called "pastmedicalhistory" via a relationship between PMHID (on survey) and ID (on pastmedicalhistory). PMHID and ID are the same, and generate automatically. PMHID is not visible on survey, but the number is visible when the layout is switched to ID. The table worked fine until about record #300 and then random tables (ie #7 and #333, #9 and #347, #341 and #359) became connected. Changing any info in the portals would change the info on both tables so that they were identical. Do you know why this is? How I can fix this? also, duplicating a record did cause the information in the portal to be removed, but the rest of the layout was intact. Thank you.
Please be advised that tables and layouts are two very different objects in FileMaker systems even though they may have identical names.
What I understand you to have as a relationship:
Survey::PMHID = pastmedicalhistory::ID
PMHID and ID are the same, and generate automatically
What do you mean by that? If you mean that both fields are defined as auto-entered serial numbers, then you will have major problems with this relationship.
One of these fields may be defined as an auto-etnered serial number, but the other should not be so defined--it should be a simple number or text field.
and then random tables
Sorry to nit pick over details but details are critical here. I believe that you mean "random records".
Changing any info in the portals would change the info on both tables so that they were identical.
How many portals are we talking about? From what you have posted so far, you would seem to have one portal. It might be a portal to pastmedicalhistory placed on the survey layout or it might be a portal to survey located on the pastmedicalHistory layout.
Let's start with one layout that has a portal on it. Enter layout mode. Select layout setup. What do you see in "Show records from" in the layout setup dialog? Then, while still in layout mode, note the name in the lower left corner of the portal. What do you see there?
The names in these two locations are the names of "table occurrences" found in Manage | Database | relationships. Each "box" on this tab panel is called a table occurrence. If I have your relationship correctly described, you should have either layout: Surver and portal: pastmedicalhistory or the reverse. If you see the same name in both locations, that's a likely explanation for some of your issues.
Now check the fields on your layout and in the portal row while in layout mode. The names of the fields on your layout should not start with ::. And the fields in the portal should start with the same name as shown in the lower corner of the same when you click them and check to see what is shown in the "display data from" box in the top of the inspector's data tab.
Screen shots of Manage | Database | Relationships and your layout (if taken in layout mode with the tool bars visible ), could help me better understand your database design.