Dim s As String Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1") For Each nd As WinForm.TreeNode In trv.AllNodes If nd.Checked AndAlso nd.Nodes.Count = 0 Then s = s & "," & nd.Text End If Next If s = "" Then e.Form.DropDownBox.Value = "" Else e.Form.DropDownBox.Value = s.trim(",") End If e.Form.DropDownBox.CloseDropdown