** END HEADER -- do not remove this line // // Generated on 2022-05-27 // parameter bModal local f f = new like_search3Form() if (bModal) f.mdi = false // ensure not MDI f.readModal() else f.open() endif class like_search3Form of FORM with (this) onOpen = class::FORM_ONOPEN onClose = class::FORM_ONCLOSE height = 17.5909 left = 1.4286 top = 0.4091 width = 148.2857 text = "" endwith this.DBASETUTORIAL1 = new DATABASE(this) with (this.DBASETUTORIAL1) left = 12.0 width = 11.0 height = 1.0 databaseName = "DBASETUTORIAL" active = true endwith this.INVOICE1 = new QUERY(this) with (this.INVOICE1) left = 26.0 width = 6.0 height = 1.0 database = form.dbasetutorial1 sql = "select i.* from invoice i where lower(i.'card name') like :search and cast(i.'order date' as char(10)) like :dsearch " params["search"] = "%" params["dsearch"] = "%" active = true endwith this.GRID1 = new GRID(this) with (this.GRID1) dataLink = form.invoice1.rowset allowEditing = false height = 8.6364 left = 5.1429 top = 3.0909 width = 139.8571 endwith this.RADIOBUTTON1 = new RADIOBUTTON(this) with (this.RADIOBUTTON1) onChange = class::RADIOBUTTON_ONCHANGE height = 1.0909 left = 11.4286 top = 13.0 width = 15.7143 text = "Contains" group = true value = true endwith this.RADIOBUTTON2 = new RADIOBUTTON(this) with (this.RADIOBUTTON2) height = 1.0909 left = 10.7143 top = 15.4091 width = 15.7143 text = "Begins with" endwith this.ENTRYFIELD1 = new ENTRYFIELD(this) with (this.ENTRYFIELD1) onGotFocus = class::ENTRYFIELD1_ONGOTFOCUS onKey = class::ENTRYFIELD_ONKEY height = 1.0 left = 83.0 top = 13.9545 width = 17.4286 value = " " endwith this.TEXTLABEL1 = new TEXTLABEL(this) with (this.TEXTLABEL1) height = 1.0 left = 80.0 top = 12.7727 width = 23.5714 text = "Search for (case insensitive)" endwith this.ENTRYFIELD2 = new ENTRYFIELD(this) with (this.ENTRYFIELD2) onGotFocus = class::ENTRYFIELD2_ONGOTFOCUS onKey = class::ENTRYFIELD_ONKEY height = 1.0 left = 113.4286 top = 13.9545 width = 19.0 value = "" endwith this.TEXTLABEL2 = new TEXTLABEL(this) with (this.TEXTLABEL2) height = 1.0 left = 113.4286 top = 12.7727 width = 21.0 text = "Search for Order Date" endwith this.RADIOBUTTON3 = new RADIOBUTTON(this) with (this.RADIOBUTTON3) onChange = class::RADIOBUTTON_ONCHANGE height = 1.0909 left = 36.5714 top = 13.2273 width = 15.7143 text = "Either field" group = true value = true endwith this.RADIOBUTTON4 = new RADIOBUTTON(this) with (this.RADIOBUTTON4) height = 1.0909 left = 36.4286 top = 15.4091 width = 15.7143 text = "Both fields" endwith function ENTRYFIELD1_onGotFocus() if form.radiobutton3.value = true form.entryfield2.value = '' endif return function ENTRYFIELD_onKey(nChar, nPosition,bShift,bControl) ***if nChar = 13 //uncomment to prevent requery until Enter is pressed if form.radiobutton1.value = true if empty(form.entryfield1.value) form.INVOICE1.params['search'] = '%' else form.INVOICE1.params['search'] = '%'+trim(lower(form.entryfield1.value))+'%' endif if empty(form.entryfield2.value) form.invoice1.params['dsearch'] = '%' else form.invoice1.params['dsearch'] = '%'+trim(form.entryfield2.value)+'%' endif elseif form.radiobutton2.value = true if empty(form.entryfield1.value) form.INVOICE1.params['search'] = '%' else form.INVOICE1.params['search'] = trim(lower(form.entryfield1.value))+'%' endif if empty(form.entryfield2.value) form.invoice1.params['dsearch'] = '%' else form.invoice1.params['dsearch'] = trim(form.entryfield2.value)+'%' endif endif form.INVOICE1.requery() ***endif return function ENTRYFIELD2_onGotFocus() if form.radiobutton3.value = true form.entryfield1.value = '' endif return function RADIOBUTTON_onChange() form.entryfield1.value = '' form.entryfield2.value = '' form.invoice1.params['search'] = '%' form.invoice1.params['dsearch'] = '%' form.invoice1.requery() return function form_onClose() form.invoice1.active = false return function form_onOpen() form.entryfield1.setfocus() return endclass