我试过使用 DCOUNT 和 SQL,但没有任何效果。我在下面粘贴了两个查询。当我运行 SQL 时,列表框中没有任何内容。当我运行 DLOOKUP 时,我收到错误消息“运行时错误 '2001”:您取消了之前的操作。组合框名称为 ScrubbedList。表名为 Scrubbed。
DCOUNT
Dim strScrubbedValue As String
strScrubbedValue = Me.ScrubbedList
Dim intCountNull As Integer
intCountNull = DCount("*", "Scrubbed", "IsNull" & strScrubbedValue)
Text267 = intCountNull
SQL
Dim strSQL As String
Dim strScrubbedValue As String
strScrubbedValue = Me.ScrubbedList
strSQL = "SELECT Count(*) As CountAll" & strScrubbedValue & " FROM Scrubbed"
strSQL = strSQL + "WHERE" & strScrubbedValue = ""
Me.List265.RowSource = strSQL