To get the row number, when you want to double click any of the cell in the DB Grid:
Step 1:
Declare a variable in the General section: Dim nRow as Integer
Then
Step 2: Private Sub DBGrid1_MouseDown(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
' To get the selected row
nRow = DBGrid1.RowContaining(Y)
End Sub
Step 3: Private Sub DBGrid1_DblClick()
.Use Message Box to display the row number by reffering nRow
End Sub
When you want to use recordset object, put this line in the click event of first, last, previous and next button of the form. nRow = Data1.Recordset.AbsolutePosition
Use this nRow to display the value or you can perform any other process which you want to do.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.