clear ** END HEADER -- do not remove this line // // Generated on 2024-02-16 // parameter bModal local f f = new wcombo1Form() if (bModal) f.mdi = false // ensure not MDI f.readModal() else f.open() endif class wcombo1Form of FORM set procedure to :wef1:\wcombo1\lgControls.cc additive with (this) onOpen = class::FORM_ONOPEN onClose = class::FORM_ONCLOSE open = class::FORM_OPEN metric = 4 // Centimeters height = 6.2442 left = 2.249 top = 2.9633 width = 17.78 endwith this.VEND1 = new QUERY(this) with (this.VEND1) left = 30.0 top = 29.0 sql = 'select * from "VEND.DBF"' active = true endwith this.MYCOMBOBOX1 = new MYCOMBOBOX(this) with (this.MYCOMBOBOX1) onChange = class::MYCOMBOBOX1_ONCHANGE height = 0.8731 left = 0.8202 top = 1.1906 width = 7.5406 dropDownHeight = 5.0006 selectAll = true endwith this.MYENTRYFIELD1 = new MYENTRYFIELD(this) with (this.MYENTRYFIELD1) onGotFocus = class::MYENTRYFIELD1_ONGOTFOCUS height = 0.8996 left = 10.2129 top = 1.4552 width = 5.8473 endwith this.ENTRYFIELD1 = new ENTRYFIELD(this) with (this.ENTRYFIELD1) dataLink = form.vend1.rowset.fields["nom"] height = 0.5821 left = 4.9477 top = 4.101 width = 4.5508 tabStop = false endwith this.TEXTLABEL1 = new TEXTLABEL(this) with (this.TEXTLABEL1) height = 0.5821 left = 2.5665 top = 4.0746 width = 2.2225 text = "Rowpointer at" endwith this.rowset = this.vend1.rowset function MYCOMBOBOX1_onChange() // mval = upper(this.value) //findkey() will find partial match mval = upper(this.value)+space(18-len(this.value)) //findkey() needs exact match if form.rowset.findkey(mval) ?"ok",mval this.before.setfocus() //Move to next control endif if not form.rowset.findkey(mval) ?"go to msgbox",mval msgbox(mVal+" not found", "Check", 0 + 16) this.value = ' ' //delete invalid name endif return function MYENTRYFIELD1_onGotFocus() //Move focus back to combobox if user enters invalid name if empty(form.mycombobox1.value) form.mycombobox1.setfocus() form.mycombobox1.keyboard('{home}') inkey(.01) //Minimal delay otherwise next instruction is skipped form.mycombobox1.keyboard('{ctrl+shift+end}') //select all endif return function form_onClose() cCuaenter = form.cuaenter set cuaenter &cCuaenter return function form_onOpen() form.cuaenter = set('cuaenter') set cuaenter off return function form_open() form.rowset.indexname = "NOMVEND" form.mvendarray = new array() form.rowset.first() // form.mvendarray.add("") do while not form.rowset.endofset form.mvendarray.add(form.rowset.fields["nom"].value) form.rowset.next() enddo form.myComboBox1.datasource = 'array form.mvendarray' form.mYCombobox1.value := 'Enter a name or select from dropdown list' return FORM::open() endclass