Public oForm oForm = Createobject('myForm') oForm.Show Define Class myForm As Form DataSession = 2 Width = 700 Add Object myGrid As Grid Procedure Load Use employee Endproc Procedure Init With This.myGrid .Width = 700 .ColumnCount = 5 With .Columns(5) .AddObject('myCommand1','myButton') .AddObject('myCommand2','myButton') .DynamicCurrentControl = ; "(Iif(Atc('sales',employee.Title) > 0,'myCommand1','myCommand2'))" .Sparse = .F. .myCommand1.Caption = 'View' .myCommand1.Visible = .T. .myCommand2.Visible = .F. && this is the default - here only to signify Endwith Endwith Endproc Enddefine Define Class myButton As CommandButton Procedure Click Messagebox(employee.notes) Endproc EnddefineCetin