
i have a form with a grid and a combo box that has 3 different values
What i want is, whenever i change this combo box value, i want the grid to change the records it shows (change range)
what i did works the first time i open the form and modify the combo box to it's different values however if i try and click on the values again it stops working
here's what i did
[Control("ComboBox")]
class ComboBoxControl
{
///
///
///
///
public boolean modified()
{
boolean ret;
ret = super();
element.setButtonAccess();
tableX_ds.executeQuery();
return ret;
}
}
[DataSource]
class tableX
{
///
///
///
public void executeQuery()
{
QueryBuildDataSource qbds;
qbds = this.query().dataSourceTable(tableNum(tableX));
if(qbds)
{
qbds.addRange(fieldNum(tableX, Enum1)).value(queryValue(ComboBoxControl.valueStr()));
}
super();
}
} Your code adds more and more ranges each time it's executed. That's why it doesn't work.
Try SysQuery::findOrCreateRange function (search the web if you need examples).