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:
  1. Private Sub mshfGridPets_Click()
  2. 'get the row to highlight
  3. intRow = mshfGridPets.MouseRow
  4. 'call my highlight
  5. Call myGridHighLight("mshfGridPets" , intRow)
  6. End Sub
  7.  
  8. Private Sub myGridHighLight(strGridName As String, intRowToHL As Integer)
  9. 'sub for rowhighlighting
  10.  
  11. 'set all cells backcolor to white to clear any highlights
  12. For intLoop = 1 To (strGridName.Rows - 1)
  13. strGridName.Row = intLoop
  14. For intInner = 0 To (strGridName.Cols - 1)
  15. strGridName.Col = intInner
  16. strGridName.CellBackColor = vbWhite
  17. Next intInner
  18. Next intLoop
  19.  
  20. 'highlight the appropriate row
  21. strGridName.Row = intRowToHL
  22. For intLoop = 0 To (strGridName.Cols - 1)
  23. strGridName.Col = intLoop
  24. strGridName.CellBackColor = vbYellow
  25. Next intLoop
  26. 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...