General information
Category:
Forms & Form designer
>Hi all,
>
> 1ª Why this code didn't work, i have a textbox to do a search, but the highlight bar don't appear in grid.
>
> LOCATE FOR ALLT(this.value) $ &pcMyTable..c_descri
> IF FOUND()
> ThisForm.Grid1.REFRESH()
> ThisForm.Grid1.setall("DynamicBackColor",;
> "Iif(ALLTRIM(&pcMyTable..c_descri) = ALLTRIM(THISFORM.GRID1.COLUMN1.TEXT1.VALUE),RGB(0,255,255),
> RGB(255,255,255))")
> this.setfocus
> ELSE
> ENDIF
> ----------------
> 2ª i have my clients table index on name.client, why when a type "joao" i don't go to the first record begin with 'joao',
> but i go to the first like 'antonio joao'.
>
*****
1.You're almost there...
try this:
LOCATE FOR ALLT(this.value) $ &pcMyTable..c_descri
IF FOUND()
ThisForm.Grid1.setall("DynamicBackColor",;
"Iif(ALLTRIM(&pcMyTable..c_descri) = ALLTRIM(THISFORM.TEXT1.VALUE),RGB(0,255,255),
RGB(255,255,255))")
ThisForm.Grid1.REFRESH()
*this.setfocus
ELSE
ENDIF
****
2. Since you issued $ operator, it checks "target string" from the "source string". Unlike the "=", it checks only the first match character from the left side of the "source string". better try to use the "=" operator than "$".
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only