I am having a problem getting the DCount function in VBA to recognize when a cell is null. In my query I have a column called STATUSDef that will either contain a 'D' or be null. Here is the code I am using to do this:
The section I am having problems with is tlh-acc. In place of [STATUSDef] <> 'D' I have also tried:
IsNull(STATUSDef)
[STATUSDef] = ''
The first one is working just fine. What do you guys know that I don't?
Code:
'tlh-def
.Cells(13, curColumn) = DCount("STATUSDef", "qryDailyTest", "STATUSDef = 'D'" & _
"and [DATE] = #" & myDate & "# and [SOURCE] = 'MAIN'")
'tlh-acc
.Cells(14, curColumn) = DCount("STATUSDef", "qryDailyTest", "[STATUSDef] <> 'D' " & _
"and [DATE] = #" & myDate & "# and [SOURCE] = 'MAIN'")
The section I am having problems with is tlh-acc. In place of [STATUSDef] <> 'D' I have also tried:
IsNull(STATUSDef)
[STATUSDef] = ''
The first one is working just fine. What do you guys know that I don't?