Hi Everyone,
I have a msFlexgrid, in which i am allowing users via a input field to type a value (ie.. new) and what i want it to do, is go into the msFlexgrid col(2) which is a miscellaneous description column so it could have many words in it, and based on the user inputs ie we, it to go thru the grid col(2) for all the records in it until it finds that word new.. the description that it should highlight and bring the entire row, of which it found this word to top of grid. (ie.. this is a new part that we are trying to implement.)
this is what i have so far. so far it goes thru the grid but only matches on entire cell, not the string within.
Thanks VBMORTON
I have a msFlexgrid, in which i am allowing users via a input field to type a value (ie.. new) and what i want it to do, is go into the msFlexgrid col(2) which is a miscellaneous description column so it could have many words in it, and based on the user inputs ie we, it to go thru the grid col(2) for all the records in it until it finds that word new.. the description that it should highlight and bring the entire row, of which it found this word to top of grid. (ie.. this is a new part that we are trying to implement.)
this is what i have so far. so far it goes thru the grid but only matches on entire cell, not the string within.
Code:
Private Sub cmdFind_Click()
Dim target_name As String
Dim r As Integer
' Get the name.
target_name = InputBox("Name", "Name", "")
If Len(target_name) = 0 Then Exit Sub
' Search for the name, skipping the column heading row.
target_name = LCase$(target_name)
For r = 1 To grdSupportCalls.Rows - 1
If LCase$(grdSupportCalls.TextMatrix(r, 2)) = target_name Then
' We found the target. Select this row.
grdSupportCalls.Row = r
grdSupportCalls.RowSel = r
grdSupportCalls.Col = 0
grdSupportCalls.ColSel = grdSupportCalls.Cols - 1
' Make the row visible.
grdSupportCalls.TopRow = r
Exit Sub
End If
Next r
' We didn't find it.
Beep
End Sub
Thanks VBMORTON