访问过滤数据

时间:2014-02-28 09:20:45

标签: vba ms-access-2010

如何在访问表单中为过滤器数据编写vba代码,其中table列为NULL,另一个table列等于Combobox

我想只在column1为Null并且column2等于组合框

时才显示表单中的记录
Private Sub Command94_Click()
If Me.Check85 = True And Me.Check87 = False Then
Dim strWhereCondition As String
strWhereCondition = "[Column2]=" & "'" & [Combo59] & "'"
DoCmd.OpenForm "Form1", , , strWhereCondition    

1 个答案:

答案 0 :(得分:1)

你已经到了一半:

strWhereCondition = " [Column1] Is NULL And [Column2] = '" & [Combo61] & "' "
DoCmd.OpenForm "Form1", , , strWhereCondition