-- 作者:sara
-- 发布时间:2015/1/23 14:36:00
-- 关于运算符后缺少操作数
If ZhiYuan.Value = "" Then Else For Each dr As Row In Tables("职员下拉_职员").GetCheckedRows If Filter<>"" Then Filter = Filter & " Or [ERP编码] = \'"& dr("ERP编码") &"\'" Else Filter = " [ERP编码] = \'"& dr("ERP编码") &"\'" End If Next End If If buMen.Value = "" Then Else Dim bHasChild As Boolean = False For Each nd As WinForm.TreeNode In tr.AllNodes If nd.Checked = True Then For Each ndChild As WinForm.TreeNode In nd.AllNodes If ndChild IsNot Nothing Then bHasChild = True Exit For End If Next If bHasChild = False Then \'最后一级结点 If Filter1 <>"" Then \' Filter1 = Filter1 & " Or [部门] = \'"& nd.Text &"\'" Else Filter1 = " [部门] = \'"& nd.Text &"\'" End If End If
End If Next MessageBox.Show(Filter1) Filter = Filter & (Filter1) MessageBox.Show(Filter) End If 打印结果是对的 此主题相关图片如下:截图00.png