Suppose you want to show or hide all rows where the age of the person listed is under 18. You have a menu prompt "Show minors" with the following onClick event handler:

function showMinors_onClick()

   if this.checked 

      form.rowset.filter := "AGE >= 18" 

   else 

      form.rowset.clearFilter() 

   endif 

   this.checked := not this.checked 

If the option is already checked, you hide the rows by setting a filter. If the option is unchecked, you clear the filter so that all rows are shown. In either case, you flip the value of the checked property.