Hi!
You can change the record in the AfterRowColChange. This event will fire after record change only when grid is refreshed or change focus. Well, if you afraid it will broke something, you can do it another way - put a timer with Interval=10 on the form and start it in the AfterRowColChange event. In the Timer event return back and do the updating by the same way as I posted a code.
HTH.
>>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:
>
>Hi Vlad,
>
>I was thinking along these lines too (in addition to more complicated KeyPress+MouseClick events of each textbox in a grid), but I was not sure, is it allowed to change record position in AfterRowColChange. Would it lead to some sort of infinitive loop? Anyway, I guess, I just can try it and this would resolve my speculations...
>
>I already passed a proposition to add a new form property to our base form class, which would control Revert button behavior (revert all or the current record). Unfortunately, all team workers are on vacation now, so I didn't get any response. I even doubt, I'll do, because it's an extremely hard work to convince to change our classes (I had lots of ideas before, but practically none of them were implemented :()
>
>Thanks.
>>
>>
>>* AfterRowColChange event
>>if recno(this.RecordSource)<>this.nRecNo
>> lnNewRecNo=recno(this.RecordSource)
>> go (this.nRecNo)
>> * do updating
>> ...
>> 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.