enabling controls at runtime

Hi All,

I am taking a control on a form whch is of option type ,If i change the option to opt2, some controls shd be turned into Enable , basically whch have Enable=false And also Some buttons on d form …

Plz help me out in this case…

Regards

Venu

Hi Venu,

In the Onvalidate trigger you can write code to enable/disable e.g.

if ( MyOption = MyOption::First ) then

Currform.Mycontrol.Enable := TRUE;

Create a new function in this form and add code similar to the following to it:

CurrForm.Field1.Enabled := Option = Option::Opt2;
CurrForm.Field2.Enabled := Option <> Option::Opt2;

Replace Field1, Field2, etc with the name of the controls you want to Enable/Disable.
Call the function in the “OnValidate” trigger of the Option field control and also on the OnAfterGetRecord function of the form.

This time Dave has been faster

First time for everything [:D]

In the on after validate trigger you can do for example

Currform.Name.ENABLED(FALSE);

Currform.UPDATECONTROLS;

This will disable the control. The update controls refreshes the form