Hi Hilmar
Sorry to pick up an old thread, for that I am keeping all the old response below for your reference.
As per your advise I have tried the following stuff. I have created a lLastRowColExit property so as to make this function discretionary
Grid.AfterRowColChange()
LPARAMETERS tnColIndex
WITH THIS
...
IF .lLastRowColExit AND tnColIndex = .COLUMNCOUNT AND .LastRow()
KEYBOARD "{TAB}{Ctrl+TAB}"
ENDIF
ENDWITH
Assuming I have flagged lLastRowColExit = .T. then the last row's last col is never allowed to be entered into.
Plus I noticed another thing that as the row col is remembered in the grid the next time I tab into the same grid it automatically exits the grid. To counter it as you might have noticed I have put in an extra {TAB} in the keyboard statement but I have not been able to enter the last textbox of the last row :(
Also I have a grid with only one column active and one row (this is a grid with precreated fixed rows, which is 1 row and out of it's 4 columns only the last column is enabled for data-entry). This grid is never allowed to be used and the KEYBOARD fires.
Please advise on how to circumvent these problems.
>Oh, you wanted that behaviour only for the last record and field? I thought you wanted to navigate through the Grid with another key.
>
>Last field: You might do the check only in the last Column.
>
>Last record: If the table or cursor does not have an active index, a filter, nor deleted records, you can check whether
recno() = reccount(). Otherwise, you will need to invoke a UDF or method that tries to skip to the next record. Something like this:
>
>
>if LastRow()
> keyboard "{Ctrl+TAB}"
>endif
>
>function LastRow()
> local lnSaveRecord, llReturnValue
> lnSaveRecord = recno()
> skip
> llReturnValue = eof()
> goto (lnSaveRecord)
> return llReturnValue
>endfunc
>