** END HEADER -- do not remove this line // // Generated on 2023-06-02 // parameter bModal local f f = new edit_formForm() if (bModal) f.mdi = false // ensure not MDI f.readModal() else f.open() endif class edit_formForm of FORM with (this) onOpen = class::FORM_ONOPEN onClose = class::FORM_ONCLOSE height = 20.0 left = 30.1429 top = 4.2727 width = 100.0 text = "" mdi = false sysMenu = false endwith this.DBASESAMPLES1 = new DATABASE(this) with (this.DBASESAMPLES1) left = 9.0 width = 11.0 height = 1.0 databaseName = "DBASESAMPLES" active = true endwith this.CUSTOMERS1 = new QUERY(this) with (this.CUSTOMERS1) width = 9.0 height = 1.0 database = form.dbasesamples1 sql = "select * from CUSTOMERS.DBF" active = true endwith with (this.CUSTOMERS1.rowset) indexName = "CUSTOMERID" endwith this.ENTRYFIELDCOMPANY1 = new ENTRYFIELD(this) with (this.ENTRYFIELDCOMPANY1) dataLink = form.customers1.rowset.fields["company"] height = 1.0 left = 11.1429 top = 5.8182 width = 42.0 endwith this.ENTRYFIELDADDRESS11 = new ENTRYFIELD(this) with (this.ENTRYFIELDADDRESS11) dataLink = form.customers1.rowset.fields["address1"] height = 1.0 left = 11.1429 top = 8.0455 width = 32.0 endwith this.ENTRYFIELDADDRESS21 = new ENTRYFIELD(this) with (this.ENTRYFIELDADDRESS21) dataLink = form.customers1.rowset.fields["address2"] height = 1.0 left = 11.1429 top = 10.3182 width = 32.0 endwith this.ENTRYFIELDCITY1 = new ENTRYFIELD(this) with (this.ENTRYFIELDCITY1) dataLink = form.customers1.rowset.fields["city"] height = 1.0 left = 11.1429 top = 12.5455 width = 22.0 endwith this.ENTRYFIELDSTATE1 = new ENTRYFIELD(this) with (this.ENTRYFIELDSTATE1) dataLink = form.customers1.rowset.fields["state"] height = 1.0 left = 11.1429 top = 14.6364 width = 4.0 endwith this.ENTRYFIELDZIP1 = new ENTRYFIELD(this) with (this.ENTRYFIELDZIP1) dataLink = form.customers1.rowset.fields["zip"] height = 1.0 left = 22.8571 top = 14.5 width = 12.0 endwith this.ENTRYFIELDFIRSTNAME1 = new ENTRYFIELD(this) with (this.ENTRYFIELDFIRSTNAME1) dataLink = form.customers1.rowset.fields["firstname"] height = 1.0 left = 56.1429 top = 7.7273 width = 17.0 endwith this.ENTRYFIELDLASTNAME1 = new ENTRYFIELD(this) with (this.ENTRYFIELDLASTNAME1) dataLink = form.customers1.rowset.fields["lastname"] height = 1.0 left = 75.1429 top = 7.8182 width = 17.0 endwith this.ENTRYFIELDPHONE1 = new ENTRYFIELD(this) with (this.ENTRYFIELDPHONE1) dataLink = form.customers1.rowset.fields["phone"] height = 1.0 left = 62.8571 top = 10.2727 width = 22.0 endwith this.PUSHBUTTON1 = new PUSHBUTTON(this) with (this.PUSHBUTTON1) onClick = class::PUSHBUTTON1_ONCLICK height = 1.0909 left = 12.8571 top = 17.9545 width = 15.2857 text = "Edit" endwith this.PUSHBUTTON2 = new PUSHBUTTON(this) with (this.PUSHBUTTON2) onClick = class::PUSHBUTTON2_ONCLICK height = 1.0909 left = 33.7143 top = 17.9545 width = 15.2857 text = "Save" endwith this.PUSHBUTTON3 = new PUSHBUTTON(this) with (this.PUSHBUTTON3) onClick = class::PUSHBUTTON3_ONCLICK height = 1.0909 left = 54.5714 top = 17.9545 width = 15.2857 text = "Abandon" endwith this.PUSHBUTTON4 = new PUSHBUTTON(this) with (this.PUSHBUTTON4) onClick = class::PUSHBUTTON4_ONCLICK height = 1.0909 left = 75.4286 top = 17.9545 width = 15.2857 text = "Close form" endwith this.TEXT1 = new TEXT(this) with (this.TEXT1) height = 4.4545 left = 24.1429 top = 0.4545 width = 50.7143 text = "

The Edit button has focus when the form opens. Either press Enter or click on the button to enable edit.

Tab moves through entryfields.

Any changes must either be saved or abandoned before the form can be closed.

" endwith this.rowset = this.customers1.rowset function PUSHBUTTON1_onClick() form.entryfieldcompany1.setFocus() // First field. User can now Tab to following fields form.customers1.rowset.beginEdit() return function PUSHBUTTON2_onClick() form.customers1.rowset.save() form.parent.customers1.requery() return function PUSHBUTTON3_onClick() form.customers1.rowset.abandon() return function PUSHBUTTON4_onClick() if form.customers1.rowset.modified = true msgbox('Data modified. Abandon or Save the changes'+chr(13)+chr(10)+ 'before the form can be closed') = 1 else form.close() endif return function form_onClose() form.customers1.active = false form.dbasesamples1.active = false return function form_onOpen() form.pushbutton1.setFocus() //When form opens pressing Enter will initiate edit mode. return endclass