if YesNo("Are you sure you want to clear all accounts?") thisform.oSearchCollection.ResetControls() thisform.ChangeFormTitle('The search results were cleared') thisform.cmdSelect.enabled = .f. && Nothing to select thisform.cmdSearch.enabled = .t. && New Search should be now available endifCode from the collection:
*---------------------- Location Section ------------------------ * Library: Aformspatientvisitsearch.vcx * Class: Colsearchcntrls * Method: Resetcontrols() *----------------------- Usage Section -------------------------- *) Description: Resets the controls to blank *) * Scope: Public * Parameters: *$ Usage: *$ * Returns: *--------------------- Maintenance Section ---------------------- * Change Log: * CREATED 11/28/2003 - JMW * MODIFIED *---------------------------------------------------------------- local ji, lcControl thisform.oBizobj.EmptySearchResult() for ji = 1 to this.count lcControl = this.getkey(m.ji) = evaluate('this.parent.' + "o" + m.lcControl + ".ResetControls()") endfor this.SetFocusToFirst()and this is EmptySearchResult() method of the biz obj:
*---------------------- Location Section ------------------------ * Library: ASearchbiz.vcx * Class: Searchobject * Method: EmptySearchResult() *----------------------- Usage Section -------------------------- *) Description: *) * Scope: Public * Parameters: *$ Usage: *$ * Returns: *--------------------- Maintenance Section ---------------------- * Change Log: * CREATED 01/12/2005 - NN * MODIFIED 05/18/2005 - NN *---------------------------------------------------------------- local lnI for lnI = 1 to alen(this.aTempAliases) if not empty(this.aTempAliases[m.lnI]) use in select(this.aTempAliases[m.lnI]) endif next dimension this.aTempAliases[1] && Reset the array store "" to this.cWhereExpr, this.cJoinExpr this.oBizRules.ClearAllRules() this.oBizRules.ClearAllWarnings() this.lNoRecordsSelected = .f. this.nRecords = 0 zap in c_SearchHere is what I've noticed: if I do a search and it returns records, when I press Clear button, the grid is empty. But if I have an empty grid to begin with, the Clear button adds this blue line.