Dear matt, This is the code that i use to select row in flexgrid. When I click the next button, this code will operate. When i click the next button, it will compare the value in the text box and in the flexgrid.if the value matched, then it will highlight the row. Can you find out any error in this code?
Private Sub cmdNext_Click() If Not Adodc1.Recordset.EOF Then Adodc1.Recordset.MoveNext Call mySuv If Adodc1.Recordset.EOF Then Adodc1.Recordset.MovePrevious End If End If End Sub
Private Sub cmdPrev_Click()
If Not Adodc1.Recordset.BOF Then Adodc1.Recordset.MovePrevious If Adodc1.Recordset.BOF Then Adodc1.Recordset.MoveNext End If End If End Sub
Private Sub mySuv() Dim i As Integer i = 1 Do While i <= Adodc1.Recordset.EOF
If txtName.Text = MSFlexGrid1.TextMatrix(i, 0) Then With MSFlexGrid1 .Row = 1 .ColSel = 1 .SetFocus End With End If Loop End Sub
regards Singaravelan
|