>Hi alls
>I have a simple table.
>It has three fields: Name, Last Name and DNI and three common index; one with name other with last name and one with name+last name.
>
>When I make the search for name, It´s Ok.
>When I make the search for last name. It´s Ok.
>
>... But when I choice the compound index (name+lastname) and make a search it doesn´t work.
>
>What could be happening..???
>
>I consider the spaces mades for the texbox, for it I use Alltrim().
>
>TIA
Andrews,
If your index is just like you wrote (name+lastname) then trimming is likely to kill your search. ie: if name and lastname are 10, 15 in length "John", "Brown" would be stored in index "John Brown ". Spaces before "Brown" are needed for a successfull search (if lastname specified).
Use a seek expression like this :
lcExpr = padr(m.name,fsize("name","mytable"))+;
padr(m.lastname,fsize("lastname","mytable"))
?seek(lcExpr,"myTable","myCombinedTag")
This makes an "exact" search. If you trim lastname part then you'd be making a search based on current state of "set exact".
Cetin