>I have a user who cannot use a mouse for medical reasons. I need her to be able to select a record from a grid without a mouse....she can obviously scroll down/up to highlight the required record, but how can I enable her to use the keyboard equivalent of clicking on the record with the mouse?
I never liked this business of having to use Ctrl-Tab or Ctrl-Shift-Tab to tab out of a grid. Even fairly windows-literate users won't guess that. I wanted the grid to work like other controls, so that you can cycle through a whole form and all the columns of a grid forwards using just Tab and backwards using just Shift-Tab. I put this in the Grid.BeforeRowColChange:
LPARAMETERS nColIndex
IF LASTKEY() = 13 OR LASTKEY() = 9
IF nColIndex = THIS.ColumnCount
KEYBOARD "{CTRL+TAB}"
ENDIF
ENDIF
IF LASTKEY() = 15
IF nColIndex = 1
KEYBOARD "{CTRL+SHIFT+TAB}"
ENDIF
ENDIF
I put this in the grid.When to handle the case where the grid has no records and shouldn't get focus:
IF RECCOUNT(THIS.Recordsource) = 0
RETURN .F.
ENDIF
It works because all of my grids are using a parameterized view.
I am not familiar with the Windows service described by Ed Rauh, so I don't know how my code would work with it.
Thanks to Dave Frankenbach and Nick Neklioudov for helping me figure these things out several weeks ago.