>>LPARAMETERS nColIndex >>local lnRecno, lcKeyValue, lcOldSetNear, lcLetter, llSearchAgain, lc4Letters >>llSearchAgain = .f. >>lcOldSetNear = set('near') >>lnRecno=recno('BldMstr') >>select LenderView >>if thisform.lJustSearched and this.nCurRec=m.lnRecno >> goto thisform.nLastRecord && Last record, which was selected in Search dialog >> thisform.KeyValue="" >> thisform.grdLender.refresh() >>* thisform.grdLender.setfocus() >>else >> lcKeyValue = iif(!empty(BldMstr.LName) ; >> and !isnull(BldMstr.LName),BldMstr.LName,substr(BldMstr.OldValue,8)) >> lc4Letters = left(m.lcKeyValue,4) >> lcKeyValue = left(m.lc4Letters,1) >> if thisform.KeyValue<> m.lcKeyValue >> thisform.KeyValue= m.lcKeyValue >> lcLetter=thisform.KeyValue >> requery() >> thisform.grdLender.refresh() >> llSearchAgain = .t. >> endif >> if thisform.cLastFour<>m.lc4Letters >> llSearchAgain = .t. >> thisform.cLastFour=m.lc4Letters >> endif >>endif >> >>if !isnull(BldMstr.LName) and m.llSearchAgain >> set near on >> seek m.lc4Letters >> if m.lcOldSetNear= "OFF" >> set near off >> endif >>endif >>select BldMstr >>with this >> * .colLName.ReadOnly=.t. >>* .parent.GrdHglt1.Highlight_Row() >> .statusbartext=space(20)+"Record "+ ; >> transform(m.lnRecno)+ ; >> " of "+transform(thisform.nRecords)+' in BldMstr' >> if .nCurRec<>recno('BldMstr') >> thisform.navstand.navupdate() >> thisform.lJustSearched=.f. >> endif >>endwith >>thisform.grdLender.SetFocus() >>this.SetFocus() >>this.colLender.ReadOnly=left(BldMstr.Lender,4)<>'MISC' >>dodefault(m.nColIndex)>>