Hello,

how to get id of selected row or clicked cell row in datagrid in vb6.0?

Thanks

Maybe something like this.

Private Sub DataGrid1_Click()

Dim x As String

x = Adodc1.Recordset("ID").Value
Adodc1.RecordSource = "Select * from Users where ID = '" & x & "'"

Label1.Caption = x

End Sub

Note that:

I used an ADODC since you did not specify what connection type you are using.
I used a label to display the ID value (selected).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.