In the following example, a form has a number of RadioButtons with text labels like Name and Address that by design match the name of indexes in the primary rowset of the form. The following onChange event handler, used by all the RadioButtons, sets the index of the primary rowset to the selected RadioButton.

function indexRadio_onChange

   if this.value 

      form.rowset.indexName := this.text 

   endif