I am new to vb.net 2005 and am desperate in need of solution as I faced error on the following codes.

Public Class Form1
Private PreviousTab As TabControl
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Load
ListNodes(TreeView1.Nodes(0))
With TreeView1.Nodes.Item("AdminMenu")
.Nodes.Item("AddCustomer").Tag = TabAddCust
.Nodes.Item("DeleteCust").Tag = TabDeleteCust
End With
End Sub
Private Sub ListNodes(ByVal StartNode As TreeNode)
Debug.WriteLine(StartNode.Name)
For Each n As TreeNode In StartNode.Nodes
ListNodes(n)
Next
End Sub

Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect
If PreviousTab IsNot Nothing Then
PreviousTab.Visible = False
End If
If e.Node.Tag IsNot Nothing Then
Dim ActiveTab As TabControl = CType(e.Node.Tag, TabControl)
ActiveTab.Visible = True
ActiveTab.Dock = DockStyle.Fill
PreviousTab = ActiveTab
End If
End Sub

When I run the program two lines of the code face error message of NullReferenceException was unhandled.

.Nodes.Item("AddCustomer").Tag = TabAddCust
.Nodes.Item("DeleteCust").Tag = TabDeleteCust

I am clueless on how to solve this.

Please help me!!!