keyval=SEEK(ALLTRIM(this.Text)+chr(nKeyCode),lcalias,lcfield)>I have a combo box class that I have been working on for a while (with help from other members on the UT) that does a QuickBooks style lookup. It works well, but now a new challenge has arisen.
> >LPARAMETERS nKeyCode, nShiftAltCtrl >if between(nKeyCode, 32, 122) > IF this.indexed > lcAlias = alltrim(This.cRowSourceAlias) > lcField = alltrim(This.cRowSourceField) > keyval=SEEK(ALLTRIM(this.Text),lcalias,lcfield) > IF keyval > nCurPos = this.selstart + 1 > this.Value = this.List(RECNO(lcalias)) > this.SelStart = nCurPos > if len(allt(this.list(RECNO(lcalias)))) - nCurPos > 0 > this.SelLength = len(allt(this.list(RECNO(lcalias)))) - nCurPos > endif > nodefault > > endif > ELSE > for x = 1 to this.ListCount > if upper(subs(this.list(x), 1, this.selstart+ 1)) = ; > upper(subs(this.text, 1, this.selstart)+chr(nKeyCode)) > nCurPos = this.selstart + 1 > this.Value = this.list(x) > this.SelStart = nCurPos > if len(allt(this.list(x))) - nCurPos > 0 > this.SelLength = len(allt(this.list(x))) - nCurPos > endif > nodefault > exit > endif > next x > ENDIF >endif > > >