Dim 截止年度 As WinForm.Label = Forms("岗位统计分析窗体").Controls("截止年度框")
Dim 截止月份 As WinForm.Label = Forms("岗位统计分析窗体").Controls("截止月份框")
Dim 列名称 As String
If 截止月份.text <= 9 Then
列名称 = “聘任岗位” & "0" & 截止月份.text
else
列名称 = “聘任岗位” & 截止月份.text
End If
Dim Filter1 As String = " 年度 = "& dr("年度") &" and 数据类型 = '期初数' " '设置条件
Filter1 = Filter1 & " and 列名称 is not null " '设置条件
Tables("弹窗窗体_岗位聘任年初年底名册").Filter = Filter1
请问其中倒数第2句中, 列名称 这样表示对吗?
想起来了,可能是这样,不知道对不对?(用&来连接)
Filter1 = Filter1 & " and “ & 列名称 ” & “ is not null " '设置条件
Filter1 = Filter1 & " and " & 列名称 & " is not null "