I have an MSFlexGrid that I am manipulating in code, and everything works except for the highlighting of the row. I can set the row, and update other labels on the form based on the selected row, but the row itself does not highlight.

If I click on the row, it does highlight. I have the highlight property set to Always, and as stated if I click on the row it highlights. But if when I use the following code, it does not highlight in either flexgrid:

Code:
Private Sub cmdRandomRoll_Click()
    Dim intTemp As Integer
    Dim rstRecords As ADODB.Recordset
    Dim strSelect As String
    
    Set rstRecords = New ADODB.Recordset
    
    intTemp = Generate_Random_Number(100, 1)
    strSelect = "SELECT ID FROM tblExperimentNature WHERE " & intTemp & " >= RollLow AND " & intTemp & " <= RollHigh"
    rstRecords.Open strSelect, adoHUConnection, adOpenKeyset, adLockOptimistic
    rstRecords.MoveFirst
    
    For intTemp = 0 To grdNature.Rows - 1
        If grdNature.TextMatrix(intTemp, 0) = rstRecords!ID Then
            grdNature.Row = intTemp
            grdNature.RowSel = grdNature.Row
            grdNature.SetFocus
            Call grdNature_Click
            Exit For
        End If
    Next
    
    rstRecords.Close

    intTemp = Generate_Random_Number(100, 1)
    strSelect = "SELECT ID FROM tblExperimentType WHERE " & intTemp & ">= RollLow AND " & intTemp & " <= RollHigh"
    rstRecords.Open strSelect, adoHUConnection, adOpenKeyset, adLockOptimistic
    rstRecords.MoveFirst
    
    For intTemp = 0 To grdType.Rows - 1
        If grdType.TextMatrix(intTemp, 0) = rstRecords!ID Then
            grdType.Row = intTemp
            Call grdType_Click
            Exit For
        End If
    Next
    
    rstRecords.Close
    Set rstRecords = Nothing
End Sub
You will see a few subroutines being called that I did not include, but these only generate a random number or populate a label on the form.

You'll also see that I'm selecting the row in 2 different ways:

1. grdNature.Row is set, then grdNature.RowSel is set, and then grdNature gets focus; AND

2. grdType.Row is set

Anybody know why the row is not being selected with the above code? Can somebody tell me what I'm doing wrong?