Private Sub grdOtherAdd_Click() Dim intRow As Integer 'holds row highlighting info 'get the row to highlight intRow = grdOtherAdd.MouseRow() 'get the primary key of this record from the address table 'oChildKey = grdOtherAdd.TextMatrix(grdOtherAdd.MouseRow, 0) 'call my highlight Call myGridHighLight(grdOtherAdd, intRow) End Suband this...
Public Sub myGridHighLight(strGridName As MSHFlexGrid, intRowToHL As Integer) Dim intLoop As Integer Dim intInner As Integer 'sub for rowhighlighting 'set all cells backcolor to white to clear any highlights For intLoop = 0 To (strGridName.Rows - 1) strGridName.Row = intLoop For intInner = 0 To (strGridName.Cols - 1) strGridName.Col = intInner If intLoop = 0 Then strGridName.CellBackColor = vbButtonFace Else strGridName.CellBackColor = vbWhite End If Next intInner Next intLoop 'highlight the appropriate row strGridName.Row = intRowToHL For intLoop = 0 To (strGridName.Cols - 1) strGridName.Col = intLoop If intRowToHL = 0 Then strGridName.CellBackColor = vbButtonFace Else strGridName.CellBackColor = vbYellow End If Next intLoop End SubI have played around with it all kinds of ways with not much success - it appears to sometimes when I click a row and then scroll to the right???