Hi,
>I have form with 2 text boxes and 2 list boxes. On the same form I have an >option group. When I select the second option I want the 2 text boxes and 2 >list boxes to grey out (Disable)
>I have tried
>IF thisform.option1.value=1 then
>thisform.text1.enable=.F.
>thisform.text2.enable=.F.
>thisform.List1.enable=.F.
>thisform.List2.enable=.F.
>else
>endif
If you want these controls disabled when the second option is chosen then you need to check for .value = 2 :
LOCAL llEnable
WITH thisform
llEnable = !(.option1.value=2)
.text1.enabled = llenable
.text2.enabled = llenable
.list1.enabled = llenable
.list2.enabled = llenable
ENDWITH
(but I suspect you just made a typo)
Since there are several situations where this code might need to be run (especially if the OptionGroup is bound) I'd put it in its own form method (or maybe in the form.refresh). The form's init() as well as the optiongroups Interactive and Programmatic change events should all run it.
Regards,
Viv