oForm = Createobject('myForm') oForm.Show Read Events Define Class myForm As Form DataSession = 2 Top = 0 Left = 0 Height = 300 Width = 500 DoCreate = .T. Caption = "Form1" Name = "Form1" Add Object grdcustomer As Grid With ; ColumnCount = 4, ; Height = 250, ; Left = 40, ; RecordSource = "customer", ; RecordSourceType = 1, ; Top = 10, ; Width = 420, ; Name = "grdCustomer" Add Object myButton As CommandButton With ; Left = 10, Top = 270, Caption = 'Show' Procedure Init With This.grdcustomer With .Column1 .ControlSource = "customer.cust_id" .Header1.Caption = 'customer ID' Endwith With .Column2 .ControlSource = "customer.company" .Header1.Caption = 'Company' Endwith With .Column3 .ControlSource = "customer.contact" .Header1.Caption = "Contact" Endwith With .Column4 .ControlSource = "crsYesno.Yesno" .Format = "M" .InputMask = ",Yes,No" .Header1.Caption = "YesNo" Endwith Endwith Endproc Procedure Load Select Cust_id, Space(3) As YesNo From customer Into Cursor crsYesno Readwrite Select customer Set Relation To Recno() Into crsYesno locate Endproc Procedure QueryUnload Clear Events Endproc Procedure myButton.Click Select a.Cust_id, a.Company, b.YesNo ; from customer a ; inner Join crsYesno b On a.Cust_id = b.Cust_id Endproc EnddefineCetin