Fox pro

*Codigo para autocompletar en un Textbox con datos de una tabla.

select tbl_inventario
total = reccount()
if between(nKeyCode, 32, 122)
for x = 1 to total
go x
if upper(subs(tbl_inventario.nombre, 1, this.selstart+ 1)) = ;
upper(subs(this.text, 1, this.selstart)+chr(nKeyCode))
nCurPos = this.selstart + 1
this.Value = tbl_inventario.nombre
this.SelStart = nCurPos
this.SelLength = len(allt(tbl_inventario.nombre)) - nCurPos
nodefault
exit
endif
next x
thisform.grid1.refresh
endif