Hi I am trying to write a sub to handle the highlighting of a row in a MSHFlexgrid when the user clicks on the row...
I don't seem to be able to pass the name of the grid properly - I think I need ByVal but I am not sure... here is my code...
VB Code:
Private Sub mshfGridPets_Click() 'get the row to highlight intRow = mshfGridPets.MouseRow 'call my highlight Call myGridHighLight("mshfGridPets" , intRow) End Sub Private Sub myGridHighLight(strGridName As String, intRowToHL As Integer) 'sub for rowhighlighting 'set all cells backcolor to white to clear any highlights For intLoop = 1 To (strGridName.Rows - 1) strGridName.Row = intLoop For intInner = 0 To (strGridName.Cols - 1) strGridName.Col = intInner strGridName.CellBackColor = vbWhite Next intInner Next intLoop 'highlight the appropriate row strGridName.Row = intRowToHL For intLoop = 0 To (strGridName.Cols - 1) strGridName.Col = intLoop strGridName.CellBackColor = vbYellow Next intLoop End Sub
Variables are declared elsewhere - with this code I get an "Invalid Qualifier" error - and strGridName is highlighted as being the problem...
Any ideas? Thanks...




Reply With Quote