I love the idea and view of the subitems in a table. I want to use this in a CRM application where secondary contacts at a company are added as subitems so they are easily viewable from the main table.
I already have a related table of contacts, with the relation being the company name field. Is there a way I can bring that related table into the main table and convert the contacts to subitems?
If I understand you correctly, you have a table with companies and main contacts, and you want to bring in secondary contacts from a separate table.
One way would be to add a button to the secondary table, to copy the entries to the main table. Use the button to populate the parent field with the relevant entry to ensure that the secondaries are entered as sub-items in the correct place.
One of the decisions you need to make is whether you want to put the contact name in the same column as the account name, of leave it blank (it can still be a sub). In my sample code above, I put the contact name in the account column (of the subitem) AND I made a contact column in the main table. In real live, you would do one or the other.
Prerequisite: in your contact table, you need a column with the exact account name (which should be the case if you are using a subtable now (or a ID number, or…).
The secret: in your master table there are two hidden columns when you turn on subitems: the columns are Parent and Subitems. You can use those names in your formula.
If this is a one time deal, you are done, if you are going to use the button later on again, you have to use AddOrModifyRows and add some stuff to prevent duplicating rows, or add some code to delete all subitems you have added to your master table. Make sure to copy your tables (duplicate) before experimenting, so you can copy and paste when things go wrong.
The full 600 contacts take just a few seconds to be added to your main table.