>Hi All,
>
>I have a grid on my VFP6.0 form that has several rows of data. One of the columns contains a field from a table that stores a filename (including fullpath). I would like to have the capability to ensure that this field is never left empty when changing to a new row in the grid. I want to have this validation only for a row change. I don't want the validation if the column changed (in the same row). The validation is simply a warning message and a file open dialog to select the file.
>
>I've been experimenting with the grid's BeforeRowColChange() and AfterRowColChange() events and cannot make the validation work correctly. The validation fires at unexpected times.
>
>Does anyone have some suggestions as to how I may accomplish my requirements?
>
>TIA. All responses are greatly appreciated.
>
>Mike
If mdown()
lnBottom = .top+.headerheight+.relativerow * .rowheight
lnTop = lnBottom - this.rowheight
lnMouseRowPos = mrow(wontop(),3)
lnMouseColPos = mcol(wontop(),3)
llChangingRow = !(between(lnMouseRowPos,lnTop, lnBottom) ;
and between(lnMouseColPos,.left,.left+.width))
Else
llChangingRow = inlist(lastkey(),24,5,18,3,145,148)
Endif
if llChangingRow and !myCheck()
nodefault
endif
Also validation is needed in grid.valid too.
Cetin