Dynamic Valuelist question

I am trying to implement an easy to use interface for selecting industries in my project. We have dozens of industries (eg. Agricultural, Automotive, etc) and each industry has sub industries (eg. for automotive you would have manufacturer, dealer, service center, etc).

My value lists are table driven (one for industry which relates to another named subindustry).

I have created 2 fields. One for “Industry” (global) and another for “subIndustry”. Industry is a radio button global field with a custom value list of industries. onDataChange runs the following code:

var maxReturnedRows = 100;
var query = "Select subindustryname from subindustry where mainindustryname = '" + globals.mainIndustry + "'";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, maxReturnedRows);

if (dataset.getMaxRowIndex() > 0)
{
application.setValueListItems('subindustry', dataset)
}

Subindustry is a checkbox field in the database [different table than the one used for value list generation] with a value list that is based on a relationship between industry table and subindustry table and it returns the subindustry name.

My problem is this:
Companies can belong to multiple industries and sub industries (Sony is in electroniccs and also in entertainment). So I need to be able to click a radio button on industry and have the subindustry field change to the appropriate checkbox list of sub industries (this works right now) and when I select a different industry the appropriate subindustry list display (this also works right now). But when I click on a subindustry, the previous is overwritten and I loose all the ones I selected in the previous industry list.

If this were FileMaker (sorry), I would create a layout for each industry and the subindustry field would have a valuelist only showing the appropriate subindustry for the selected industry. The values selected while viewing a different industry would not be overwritten because they would not be visible. I have tried to do this several ways in Servoy and nonw work the way I had hoped.

Is there a way to have one field use multiple valuelists and not loose the prior selected values? I am sure there is and I am just missing something.

Thanks in advance for your help.