So I have found the MSHFlexGrid control. With some searching, I have found out how to bind it to a ADODB.Recordset and display the results on the form. I have also been able to create a text box, and when the user types in the text box, key through the grid to find those matching rows in the grid.
Here is the problem I am running into, and can't seem to find anywhere on the net. How do I programatically make the first row I come across the "Selected row"?
The above code is in my Textbox.KeyUp event. I tried adding a line that says:Code:Dim iCounter as Long If (Len(sString) = 0) Then Me.flexGrid.row = 0 Else For iCounter = 0 To (Me.flexGrid.Rows - 1) Step 1 If (Left(Me.flexGrid.TextMatrix(iCounter, iColumnNum), Len(sString)) = sString) Then 'The values match Exit For End If Next iCounter End If
Me.flexGrid.Row = iCounter
but that didn't set the selected row like I hoped.
Is there a simple solution that I'm overlooking?




Reply With Quote