John
You are defining lnRow inside the WITH...ENDWITH but this is not necessary at this point since the variable is not being referenced in the SETALL method.
What is necessary is that lnRow must be accessible to the code in the DynamicFore/BackColor expression while the form/grid runs. A possible cause of your described problem is that lnRow goes out of scope and then the expression will fail. Perhaps a better solution would be to make lnRow a property of the form.
>Hi,
>Here is the expression:
>
>
>with thisform
> lnRow = 0
> .grid1.SETALL("DynamicBackColor", ;
> "IIF(RECNO('mytest')=lnRow , RGB(0,0,128) , RGB (255,255,255))", "Column")
> .grid1.SETALL("DynamicForeColor", ;
> "IIF(RECNO('mytest')=lnRow , RGB(255,255,255) , RGB (0,0,0))", "Column")
>endwith
>
>
>
>It cause error only after the program run for 7-8 hours.
>
>Any ideas?
>
>Thank you
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.