I've been wanting to use TreeView and ListView for awhile now, but - I can't do it!
I found this code on the net (not sure where I found it) and it has, as a basic sample for using the controls, the following:
Private Sub Form_Load()
'Declare Variables
Dim mNode As Node
Dim i As Integer
'Populate the list box
List1.AddItem "Node 1"
List1.AddItem "Node 2"
List1.AddItem "Node 3"
'Add the primary node
Set mNode = TreeView1.Nodes.Add()
mNode.Text = "Primary Node"
'Add the nodes from the list box
For i = 0 To List1.ListCount - 1
Set mNode = TreeView1.Nodes.Add(1, tvwChild)
mNode.Text = List1.List(i)
Next i
End Sub
The problem is, List1 doesn't know what "AddItem" is, and TreeView1 doesn't know what a node is! - ie, these methods, or collection references don't show up in the selectable list when I press the '.' after the object's name. AND, I get the following error message when I try to open the form:
"Run-time error '438':
Object doesn't support this property or method.
And Debug drops me on the first List1.AddItem line.
I tried useing this in Access98, and it didn't work. Then I thought this might not be useable in Access, and tried it in Visual Basic 6.0 (Enterprise Edition) (on a different PC), and it still did not work for me.
PLEASE HELP!
MoGryph
- "Don't mess with my crew-cut [8O)"
I found this code on the net (not sure where I found it) and it has, as a basic sample for using the controls, the following:
Private Sub Form_Load()
'Declare Variables
Dim mNode As Node
Dim i As Integer
'Populate the list box
List1.AddItem "Node 1"
List1.AddItem "Node 2"
List1.AddItem "Node 3"
'Add the primary node
Set mNode = TreeView1.Nodes.Add()
mNode.Text = "Primary Node"
'Add the nodes from the list box
For i = 0 To List1.ListCount - 1
Set mNode = TreeView1.Nodes.Add(1, tvwChild)
mNode.Text = List1.List(i)
Next i
End Sub
The problem is, List1 doesn't know what "AddItem" is, and TreeView1 doesn't know what a node is! - ie, these methods, or collection references don't show up in the selectable list when I press the '.' after the object's name. AND, I get the following error message when I try to open the form:
"Run-time error '438':
Object doesn't support this property or method.
And Debug drops me on the first List1.AddItem line.
I tried useing this in Access98, and it didn't work. Then I thought this might not be useable in Access, and tried it in Visual Basic 6.0 (Enterprise Edition) (on a different PC), and it still did not work for me.
PLEASE HELP!
MoGryph
- "Don't mess with my crew-cut [8O)"