******** Start of example code ********* ******* Watch for line wrap *********** if file('test_lookup.dbf') // drop table test_lookup endif if not file('test_lookup.dbf') create table test_lookup (id autoinc,data1 character(15),data2 character(15)) //endif insert into test_lookup (data1,data2) values ("Alpha","First") insert into test_lookup (data1,data2) values ("Baker","Second") insert into test_lookup (data1,data2) values ("Charlie","Third") insert into test_lookup (data1,data2) values ("Delta","Fourth") endif if file('test_lookup1.dbf') // drop table test_lookup1 endif if not file('test_lookup1.dbf') create table test_lookup1 (id autoinc,name numeric(10,0)) //endif insert into test_lookup1 (name) values (2.00) insert into test_lookup1 (name) values (1.00) insert into test_lookup1 (name) values (4.00) insert into test_lookup1 (name) values (3.00) endif ** END HEADER -- do not remove this line // // Generated on 08/30/2018 // parameter bModal local f f = new test_lookupForm() if (bModal) f.mdi = false // ensure not MDI f.readModal() else f.open() endif class test_lookupForm of FORM with (this) height = 16.4545 left = 41.5714 top = 4.8182 width = 57.2857 text = "" endwith this.TEST_LOOKUP11 = new QUERY(this) with (this.TEST_LOOKUP11) left = 19.0 top = 1.0 width = 10.0 height = 1.0 sql = 'select * from "test_lookup1.DBF"' active = true endwith with (this.TEST_LOOKUP11.rowset) with (fields["name"]) lookupSQL = "select * from test_lookup" endwith endwith this.COMBOBOX1 = new COMBOBOX(this) with (this.COMBOBOX1) onChange = class::COMBOBOX1_ONCHANGE onOpen = class::COMBOBOX1_ONOPEN dataLink = form.test_lookup11.rowset.fields["name"] height = 1.0 left = 3.1429 top = 6.0 width = 21.2857 style = 1 // DropDown endwith this.ENTRYFIELD1 = new ENTRYFIELD(this) with (this.ENTRYFIELD1) height = 1.0 left = 28.1429 top = 5.9545 width = 14.8571 value = "" endwith function COMBOBOX1_onChange form.entryfield1.value = form.test_lookup11.rowset.fields["name"].lookuprowset.fields["data2"].value return function COMBOBOX1_onOpen this .value = "Pick a name" return endclass *************** End of example code