我用下面的代码实现新增功能:
Dim tr As WinForm.TreeView = e.Form.Controls("TreeView1")
Dim nd As WinForm.TreeNode = tr.SelectedNode
If nd IsNot Nothing Then
Dim pth() As String = nd.FullPath.Split("\")
Select Case nd.Level
Case 2
Tables("工程主表.支付明细表").AddNew
Tables("工程主表.支付明细表").Current("工程类别") = pth(1)
Tables("工程主表.支付明细表").Current("工程编号") = pth(2)
End Select
End If
运行后出现如下提示:
Object reference not set to an instance of an object.
请问需要怎么修改?请指教,谢谢!