|
4#
楼主 |
发表于 2020-8-29 20:01:51
|
只看该作者
经过折腾数日,查看了不少资料,终于落地.现发出供需者参考:
Private Sub AllChildSynchro(ByVal NodeChoose As Object)
On Error Resume Next
Dim lNextLoop, PP As Long
Dim ObjChildren As Object
PP = Val(Mid(NodeChoose.Key, 2))
If CBool(NodeChoose.Children > 0) Then
Set ObjChildren = NodeChoose.Child
For lNextLoop = 1 To NodeChoose.Children
ObjChildren.Checked = NodeChoose.Checked
If ObjChildren.Checked = True Then
CurrentDb.Execute "UPDATE 表一 SET 查询标识 =True WHERE 族人代码=" & Val(Mid(ObjChildren.Key, 2)) & " OR 族人代码=" & PP
Else
CurrentDb.Execute "UPDATE 表一 SET 查询标识 =False WHERE 族人代码=" & Val(Mid(ObjChildren.Key, 2)) & " OR 族人代码=" & PP
End If
If ObjChildren.Children > 0 Then Call AllChildSynchro(ObjChildren)
Set ObjChildren = ObjChildren.Next
Next lNextLoop
End If
End Sub
|
|