I have some code that counts the number of times that 0 (zero) is entered in a table. I want to save this to a variable and print it out in a msgbox. What I get as the variable is a repeat of the select statement. what am I doing wrong? Here is my code
Dim Zeros As Integer
Zeros = "SELECT Count(MarketDat aTemp.ACPS) AS CountOfACPS" & _
"FROM MarketDataTemp" & _
"WHERE (((MarketDataTe mp.ACPS)=0));"
Debug.Print Zeros
MsgAnswer = MsgBox("There are " & Zeros & "prices equal to '0' in the MarketData file", vbYesNo)
If MsgAnswer = 7 Then
Exit Sub
End If
Dim Zeros As Integer
Zeros = "SELECT Count(MarketDat aTemp.ACPS) AS CountOfACPS" & _
"FROM MarketDataTemp" & _
"WHERE (((MarketDataTe mp.ACPS)=0));"
Debug.Print Zeros
MsgAnswer = MsgBox("There are " & Zeros & "prices equal to '0' in the MarketData file", vbYesNo)
If MsgAnswer = 7 Then
Exit Sub
End If
Comment