I
Ian Mellors
Hi,
here's the senario
I've got two forms
Edit_Risks1 - Form containing a treeview control. This
control shows documents that are attached to each other.
SafetyCase_document_Attach - Edit form allowing
attachment. This form is displayed by clicking on a node
in the treeview.
In SafetyCase_document_Attach there is the following code
Private Sub Form_Close()
Call Form_Edit_Risks1.NodeRefresh
End Sub
which calls the following in Edit_Risks1
Public Sub NodeRefresh()
If CurrentNode.Children = 0 Then Exit Sub
' Remove current children and re-fill children list
For X = 1 To CurrentNode.Children
TvwObj.Nodes.Remove CurrentNode.child.index
Next
sTag = CurrentNode.Tag
iLevel = Asc(Left(sTag, 1)) - 64
If iLevel < 10 Then Call FillTreeview(CurrentNode,
iLevel + 1)
End Sub
CurrentNode is defined in the declarations section of
Edit_Risks1 and is a copy of the current Node object.
This works great as long as Edit_risks1 is a STAND ALONE
form. However, if the form is then made a sub-form of a
much larger tabbed form (or any other form for that
matter), I get the following error;
Run time error 91
Object variable or With Block variable not set
What's wrong??????
here's the senario
I've got two forms
Edit_Risks1 - Form containing a treeview control. This
control shows documents that are attached to each other.
SafetyCase_document_Attach - Edit form allowing
attachment. This form is displayed by clicking on a node
in the treeview.
In SafetyCase_document_Attach there is the following code
Private Sub Form_Close()
Call Form_Edit_Risks1.NodeRefresh
End Sub
which calls the following in Edit_Risks1
Public Sub NodeRefresh()
If CurrentNode.Children = 0 Then Exit Sub
' Remove current children and re-fill children list
For X = 1 To CurrentNode.Children
TvwObj.Nodes.Remove CurrentNode.child.index
Next
sTag = CurrentNode.Tag
iLevel = Asc(Left(sTag, 1)) - 64
If iLevel < 10 Then Call FillTreeview(CurrentNode,
iLevel + 1)
End Sub
CurrentNode is defined in the declarations section of
Edit_Risks1 and is a copy of the current Node object.
This works great as long as Edit_risks1 is a STAND ALONE
form. However, if the form is then made a sub-form of a
much larger tabbed form (or any other form for that
matter), I get the following error;
Run time error 91
Object variable or With Block variable not set
What's wrong??????