DEFINE CLASS opglogic AS optiongroup ButtonCount = 2 Value = 1 ControlSource = "This.nControlValue" Height = 46 Width = 71 ncontrolvalue = 1 datasource = "" Name = "opglogic" Option1.Caption = "Yes" Option1.Value = 1 Option1.Height = 17 Option1.Left = 5 Option1.Top = 5 Option1.Width = 61 Option1.Name = "ogbYes" Option2.Caption = "No" Option2.Height = 17 Option2.Left = 5 Option2.Top = 24 Option2.Width = 61 Option2.Name = "ogbNo" PROCEDURE ncontrolvalue_assign LPARAMETERS vNewVal *To do: Modify this routine for the Assign method IF !EMPTY(This.DataSource) cDataSource=This.DataSource REPLACE (cDataSource) WITH IIF(vNewVal=2,.F.,.T.) ENDIF THIS.nControlValue = m.vNewVal ENDPROC PROCEDURE Init IF !EMPTY(This.DataSource) cDataSource=This.DataSource This.Value=IIF(!&cDataSource,2,1) ENDIF ENDPROC ENDDEFINE