【问题标题】:Access filter data访问过滤器数据
【发布时间】:2014-02-28 09:20:44
【问题描述】:

如何为访问表单中的过滤数据编写vba代码,其中表列为NULL,另一个表列等于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    

【问题讨论】:

  • 请提高您问题的“质量”以便更好地理解...

标签: vba ms-access-2010


【解决方案1】:

你已经成功了一半:

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

【讨论】:

  • 感谢您的回复。但它不起作用。它仍然显示所有等于组合框但不为空的值
  • “但不为空”是什么意思?您想要 column1 null 或 column2 等于您的组合的值吗?或者 column1 null AND column2 等于组合的那些?
猜你喜欢
  • 2023-03-13
  • 2023-03-17
  • 1970-01-01
  • 2018-06-15
  • 2019-02-26
  • 1970-01-01
  • 2015-08-31
  • 2017-08-07
  • 2023-04-05
相关资源
最近更新 更多