There are times when you need to change the company your are focusing on when processing code. The methodology for this is to use the command ChangeCompany int he following format:
There is however a problem, where Select statements and other commands will not use the correct company within this statement. To get around this problem you need to ensure each table you plan to use has been nulled before use.
For example if you wanted to get information from the customer table, you need to ensure the CustTable = null; is run within the …code… area before the use of the table.