> Hi Stefan,
> Thanks alot,
> i have a form with a grid eg grid1. In the click prodedure of grid1 in column4, i have this code.
>
> WITH THISFORM
> DO CASE
> CASE .grid1.column3.text1.value>80
> thisform.grid1.column4.text1.value="Distinction"
>
> CASE .grid1.column3.text1.value>=70
> thisform.grid1.column4.text1.value="Credit"
>
> CASE .grid1.column3.text1.value>=55
> thisform.grid1.column4.text1.value="pass"
>
> CASE .grid1.column3.text1.value<55
> thisform.grid1.column4.text1.value="Fail"
> ENDCASE
> ENDWITH
>
> The code is working well, but when i move to the next cell in the next row, the value of the upper cell is inserted into this new cell and not a new value eg a new grade. The grade should change depending on the value of marks in a given cell
>
I'd suggest not to use a Click() event for that, try the following in your Grid1.Column3.Text1.Valid() (Replace "yourResultField" in the code with your desired field name, i.e. the column4.ControlSource):
LOCAL lnResult
lnResult = This.Value
REPLACE NEXT 1 yourResultField With ICASE( ;
m.lnResult > 80, 'Distinction', ;
m.lnResult >= 70, 'Credit', ;
m.lnResult >= 55, 'pass', ;
m.lnResult < 55, 'Fail', ;
'n/a' ) IN This.Parent.Parent.RecordSource
hth
-Stefan