By "table" do you mean a Table Occurrence box found in tManage | Database | Relationships?
You can open that window and double click a box to open a dialog where you can redirect the occurence to refer to a different data source table. But this is not something that you can do dynamically from a layout or script.
It would be best to replace your two separate tables with one table that stores info for both companies. A company ID field in such a table can be used to keep the data for one company separate from another.
I am using sql as my source. I meant to say database not tables sorry. Basically I want to replicate the solution I am working on and just change the database name. Is that possible?