Modify Form dummy && this is temp anyway [ENTER]-Add customer to form's dataenvironment
Public oForm oForm = Createobject('SampleForm') oForm.Show() Define Class SampleForm As Form DataSession=2 Height = 300 Width = 520 Add Object grdCustomer As Grid With ; RecordSource='Customer',ColumnCount=1,; DeleteMark=.F.,RecordMark=.F.,SplitBar=.F.,ScrollBars=2,; Height=300,Width=520,; HeaderHeight=0,RowHeight=300 Procedure Load Set Multilocks On Use (_samples+'data\customer') CursorSetProp("Buffering",5,'Customer') Endproc Procedure Init With This.grdCustomer.Columns(1) As Column .AddObject('myCustomer','myCustomer') .CurrentControl = 'myCustomer' .Sparse = .F. .Width = 500 .myCustomer.Visible = .T. Endwith Endproc Enddefine Define Class myCustomer As Container Width = 500 Height = 300 BackStyle = 0 BorderWidth = 0 Add Object lblcust_id As Label With ; Left = 0, Top = 0, AutoSize = .T., BackStyle = 0, Caption = "Cust_id" Add Object txtcust_id As TextBox With ; Left = 70, Top = 0, Width = 55, ControlSource = "customer.cust_id" Add Object lblcompany As Label With ; Left = 0, Top = 25, AutoSize = .T., BackStyle = 0, Caption = "Company" Add Object txtcompany As TextBox With ; Left = 70, Top = 25, Width = 280, ControlSource = "customer.company" Add Object lblcontact As Label With ; Left = 0, Top = 50, AutoSize = .T., BackStyle = 0, Caption = "Contact" Add Object txtcontact As TextBox With ; Left = 70, Top = 50, Width = 220, ControlSource = "customer.contact" Add Object lbltitle As Label With ; Left = 0, Top = 75, AutoSize = .T., BackStyle = 0, Caption = "Title" Add Object txttitle As TextBox With ; Left = 70, Top = 75, Width = 220, ControlSource = "customer.title" Add Object lbladdress As Label With ; Left = 0, Top = 100, AutoSize = .T., BackStyle = 0, Caption = "Address" Add Object txtaddress As TextBox With ; Left = 70, Top = 100, Width = 430, ControlSource = "customer.address" Add Object lblcity As Label With ; Left = 0, Top = 125, AutoSize = .T., BackStyle = 0, Caption = "City" Add Object txtcity As TextBox With ; Left = 70, Top = 125, Width = 120, ControlSource = "customer.city" Add Object lblregion As Label With ; Left = 0, Top = 150, AutoSize = .T., BackStyle = 0, Caption = "Region" Add Object txtregion As TextBox With ; Left = 70, Top = 150, Width = 120, ControlSource = "customer.region" Add Object lblpostalcode As Label With ; Left = 0, Top = 175, AutoSize = .T., BackStyle = 0, Caption = "Postalcode" Add Object txtpostalcode As TextBox With ; Left = 70, Top = 175, Width = 80, ControlSource = "customer.postalcode" Add Object lblcountry As Label With ; Left = 0, Top = 200, AutoSize = .T., BackStyle = 0, Caption = "Country" Add Object txtcountry As TextBox With ; Left = 70, Top = 200, Width = 115, ControlSource = "customer.country" Add Object lblphone As Label With ; Left = 0, Top = 225, AutoSize = .T., BackStyle = 0, Caption = "Phone" Add Object txtphone As TextBox With ; Left = 70, Top = 225, Width = 180, ControlSource = "customer.phone" Add Object lblfax As Label With ; Left = 0, Top = 250, AutoSize = .T., BackStyle = 0, Caption = "Fax" Add Object txtfax As TextBox With ; Left = 70, Top = 250, Width = 180, ControlSource = "customer.fax" Add Object lblmaxordamt As Label With ; Left = 0, Top = 275, AutoSize = .T., BackStyle = 0, Caption = "Maxordamt" Add Object txtmaxordamt As TextBox With ; Left = 70, Top = 275, Width = 70, ControlSource = "customer.maxordamt" EnddefineCetin