Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Highlighting expression error
Message
From
21/09/2000 14:14:47
 
 
To
21/09/2000 14:08:43
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00419140
Message ID:
00419200
Views:
30
Joe, the trick is that you do not specify exact alias name in recno() function suggesting that it is always current alias as it is after 'select tranfile'. Than, you assign DynamicBackColor - its ok. However, when user made some actions on the form, current alias changed from tranfile to other workarea where no any cursor opened. So recno() function no longer valid because no cursor opened in current workarea. When grid refreshes, it try to calculate the DynamicBackColor expression and fails.
SO, to avoid such problem, use recno("tranfile") inside of DynamicBackColor expression, like following:

PUBLIC grno
select tranfile
grno = RECNO()
THISform.pageframe1.page1.grid1.setall("Dynamicbackcolor", ;
"IIF(RECNO("tranfile")=grno,RGB(128,192,192),RGB(255,255,255))","Column")


>Thanks for the suggestions. Either way I'm still getting the error periodically. Here's my exact code in the different places I have them:
>
>---AfterRowcolChange
>LPARAMETERS nColIndex
>select tranfile
>grno = RECNO()
>THISform.pageframe1.page1.grid1.setall("Dynamicbackcolor", ;
> "IIF(RECNO()=grno,RGB(128,192,192),RGB(255,255,255))","Column")
>select receipt
>THISFORM.PAGEFRAME1.PAGE1.REFRESH()
>
>----Grid Init
>PUBLIC grno
>select tranfile
>grno = RECNO()
>THISform.pageframe1.page1.grid1.setall("Dynamicbackcolor", ;
> "IIF(RECNO()=grno,RGB(128,192,192),RGB(255,255,255))","Column")
>
>----Grid Refresh
>select tranfile
>grno = RECNO()
>THISform.pageframe1.page1.grid1.setall("Dynamicbackcolor", ;
> "IIF(RECNO()=grno,RGB(128,192,192),RGB(255,255,255))","Column")
>select receipt
>
>Thanks.
>
>Joe
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform