Hi!
This always was a problem with grids. You can catch the events before the BeforeRowColChange event by using the transparent cover shape for grid OR by using the mrow()/mcol() functions, and by using KeyPress event of the form with KeyPreview=.T. However, this is for the most universal case.
I would suggest you to use the 5-th buffering anyway (because 3-d buffering is dangerous when using grds because automatic update during grid refresh - record is moved), than try following:
if recno(this.RecordSource)<>this.nRecNo
lnNewRecNo=recno(this.RecordSource)
go (this.nRecNo)
...
if lSuccess
go (lnNewRecNo)
this.nRecNo = lnNewRecNo
endif
endif
HTH.
>Hi everybody,
>
>I have a problem, which I can't figure out. In the valid of grid (which I call from each textbox in a grid) I determine, if fields were changed or not, and set the form flag lFieldChanged appropriately. Now when I leave this row, I want to update two fields in it. I tried AfterRowColChange method, but I update the new record, not the record, I was sitting before. Do you know, how to solve this problem?
>
>Here is my code:
>
>if .lFieldChanged
> if inlist(.ProcType,'siteproc','ownrproc')
> replace (.AddrField) with '6', ModiType with 'C'
> else
> replace (.AddrField) with '6'
> endif
> .lFieldChanged=.f.
> endif
>
>Thanks a lot in advance.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #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.