INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS
Come Join Us!
Are you a
Computer / IT professional?
Join Tek-Tips now!
- Talk With Other Members
- Be Notified Of Responses
To Your Posts
- Keyword Search
- One-Click Access To Your
- Automated Signatures
On Your Posts
- Best Of All, It's Free!
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.
Partner With Us!
"Best Of Breed" Forums Add Stickiness To Your Site
(Download This Button Today!)
"...Thanks for a great forum. My problem was answered just by scrolling through previously solved problems.
Where in the world do Tek-Tips members come from?
DB Grid : Row Number
How to get the selected row number from a DB Grid?
Posted: 6 Jul 01
To get the row number, when you want to double click any of the cell in the DB Grid:
Declare a variable in the General section:
Dim nRow as Integer
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)
Private Sub DBGrid1_DblClick()
.Use Message Box to display the row number by reffering nRow
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.
Back to Visual Basic(Microsoft): Version 5 & 6 FAQ Index
Back to Visual Basic(Microsoft): Version 5 & 6 Forum
Join Tek-Tips® Today!
Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.
Here's Why Members Love Tek-Tips Forums:
- Talk To Other Members
- Notification Of Responses To Questions
- Favorite Forums One Click Access
- Keyword Search Of All Posts, And More...
Register now while it's still free!
Already a member? Close this window and log in.
Join Us Close