>Tore,
>In essence, it is like :-
>sele top 50 prodcode, proddesc ;
>from tstokmast ;
>order by 1,2 ;
>into cursor c_prodlist
>
>I'm using macro substitution for prodcode and proddesc as its a parameter passed from a base form. (&firstfield where firstfield value is "prodcode").
>I just typed this into the command window and the result is no better.
>Yau
Select NOTHING until the user types at least one charecter! Start with an empty cursor which you can create in the form's load event:
sele prodcode, proddesc from tstokmast into cursor c_dummy readwrite where .f.
in the lostfoxus of the textbox to enter the first letter(s):
lcText=upper(alltrim(this.value))
sele top 50 prodcode, proddesc ;
from tstokmast ;
order by 1,2 ;
into cursor c_dummy nofilter where prodcode=lcText
sele c_prodlist
zap
appe from dbf('c_dummy')
this.parent.grdProdcode.setfocus()