if file('sex_name.dbf') drop table sex_name endif if not file('sex_name.dbf') create table sex_name (sex character(1),sex_name character(6)) insert into sex_name (sex,sex_name) values ("M","Male") insert into sex_name (sex,sex_name) values ("m","Male") insert into sex_name (sex,sex_name) values ("F","Female") insert into sex_name (sex,sex_name) values ("f","Female") endif if file('test_sex_name.dbf') drop table test_sex_name endif if not file('test_sex_name.dbf') create table test_sex_name (id autoinc,name character(15),sex character(1)) insert into test_sex_name (name,sex) values ("Arthur","M") insert into test_sex_name (name,sex) values ("Albert","m") insert into test_sex_name (name,sex) values ("Anne","F") insert into test_sex_name (name,sex) values ("Angela","f") endif ** END HEADER -- do not remove this line // // Generated on 2017-07-14 // parameter bModal local f f = new test_sex_nameForm() if (bModal) f.mdi = false // ensure not MDI f.readModal() else f.open() endif class test_sex_nameForm of FORM with (this) height = 22.5455 left = 40.8571 top = 4.8636 width = 74.0 text = "" endwith this.TEST_SEX_NAME1 = new QUERY(this) with (this.TEST_SEX_NAME1) left = 36.0 width = 11.0 height = 1.0 sql = 'select * from "test_sex_name.DBF"' active = true endwith this.TEST_SEX_NAME2 = new QUERY(this) with (this.TEST_SEX_NAME2) left = 48.0 width = 11.0 height = 1.0 sql = 'select * from "test_sex_name.DBF"' active = true endwith with (this.TEST_SEX_NAME2.rowset) with (fields["sex"]) lookupSQL = "select * from sex_name" endwith endwith this.GRID1 = new GRID(this) with (this.GRID1) dataLink = form.test_sex_name1.rowset allowEditing = false height = 6.5 left = 3.0 top = 1.5 width = 56.0 endwith this.ENTRYFIELD1 = new ENTRYFIELD(this) with (this.ENTRYFIELD1) dataLink = form.test_sex_name2.rowset.fields["name"] height = 1.0 left = 20.0 top = 18.5 width = 8.0 endwith this.GRID2 = new GRID(this) with (this.GRID2) dataLink = form.test_sex_name2.rowset allowEditing = false height = 6.5 left = 3.0 top = 10.5 width = 66.0 endwith this.TEXTLABEL1 = new TEXTLABEL(this) with (this.TEXTLABEL1) height = 1.0 left = 3.0 top = 0.5 width = 12.0 text = "Raw data" endwith this.TEXTLABEL2 = new TEXTLABEL(this) with (this.TEXTLABEL2) height = 1.0 left = 3.0 top = 9.5 width = 19.0 text = "Data with lookupSQL" endwith this.PUSHBUTTON1 = new PUSHBUTTON(this) with (this.PUSHBUTTON1) onClick = class::PUSHBUTTON1_ONCLICK height = 1.0909 left = 8.0 top = 20.5 width = 15.2857 text = "Append" endwith this.PUSHBUTTON2 = new PUSHBUTTON(this) with (this.PUSHBUTTON2) onClick = class::PUSHBUTTON2_ONCLICK height = 1.0909 left = 50.0 top = 20.5 width = 15.2857 text = "Save" endwith this.COMBOBOX1 = new COMBOBOX(this) with (this.COMBOBOX1) dataLink = form.test_sex_name2.rowset.fields["sex"] height = 1.0 left = 45.0 top = 18.5 width = 12.0 dataSource = 'array {"Male","Female"}' style = 1 // DropDown endwith this.rowset = this.test_sex_name1.rowset function PUSHBUTTON1_onClick() form.test_sex_name2.rowset.beginAppend() form.entryfield1.setfocus() return function PUSHBUTTON2_onClick() form.test_sex_name2.rowset.save() form.test_sex_name1.requery() return endclass