1) I want to get a treeview to be generate with following recordset so how can I do this ?
Sorry ! not work with treeview control before in VB 6.0?
Code:
Recordset : SELECT userm FROM usermaster WHERE deleted = No
attached image is displays how treeview should looks.
2) Another que. is that when I click on perticular node of treeview(username) then what shall I write in WHERE condition of recordset which I am using to display records in grid
Code:
e.g. Select password,active from usermaster where username = 'Admin' (treeview node name)
Note :
1) Please use [vbcode]your code goes in here [/vbcode] tags when posting VB code.
2) Please mark thread as Resolved using the Thread Tools menu, if you got solution.
Note :
1) Please use [vbcode]your code goes in here [/vbcode] tags when posting VB code.
2) Please mark thread as Resolved using the Thread Tools menu, if you got solution.
Private Sub Form_Load()
Dim nd As Node, nd2 As Node
Set nd = t.Nodes.Add(, , "Root", "FRRO Navigator") 'parent node
nd.Expanded = True
'select query
Dim n As Integer
n = 0
Do While Not n = Str(rs.RecordCount)
Set nd = t.Nodes.Add("Root", tvwChild, , rs.Fields(0).Value) ' child node assuming field(0) is the users
n = n + 1
Loop
End Sub
Private Sub t_Click()
If t.SelectedItem.Selected Then MsgBox t.Nodes(t.SelectedItem.Index).Text
'"Select password,active from usermaster where username = '"& t.Nodes(t.SelectedItem.Index).Text &"'" (treeview node name)
End Sub
hope this helps
Last edited by mikee_phil; Feb 16th, 2006 at 06:03 AM.
Private Sub Form_Load()
Dim nd As Node, nd2 As Node
Set nd = t.Nodes.Add(, , "Root", "FRRO Navigator") 'parent node
nd.Expanded = True
'select query
Dim n As Integer
n = 0
Do While Not n = Str(rs.RecordCount)
Set nd = t.Nodes.Add("Root", tvwChild, , rs.Fields(0).Value) ' child node assuming field(0) is the users
n = n + 1
Loop
End Sub
Private Sub t_Click()
If t.SelectedItem.Selected Then MsgBox t.Nodes(t.SelectedItem.Index).Text
'"Select password,active from usermaster where username = '"& t.Nodes(t.SelectedItem.Index).Text &"'" (treeview node name)
End Sub
hope this helps
Thanx buddy for your reply, let me try by your method & but Please use [vbcode ] your code goes in here [/Highlight] tags when posting code.
Note :
1) Please use [vbcode]your code goes in here [/vbcode] tags when posting VB code.
2) Please mark thread as Resolved using the Thread Tools menu, if you got solution.
Note :
1) Please use [vbcode]your code goes in here [/vbcode] tags when posting VB code.
2) Please mark thread as Resolved using the Thread Tools menu, if you got solution.