T
Tom Nowak
I am wrting some VB in an Access 2003 database, and I want to get a COUNT to
display in a msgbox. Here is a portion of my code:
'Loop through recordset
Do Until rst1.EOF
str1 = "'%" & rst1("phrase") & "%'"
With cmd1
.ActiveConnection = CurrentProject.Connection
.CommandText = _
"SELECT Count(*) FROM dec2007 " & _
"WHERE prob_summ LIKE " & str1
.CommandType = adCmdText
.Execute
End With
MsgBox ("The number of records that contain " & rst1("phrase") & _
" is " & int1)
I am not sure how to get the number of records found into the int1 variable.
Please Help.
display in a msgbox. Here is a portion of my code:
'Loop through recordset
Do Until rst1.EOF
str1 = "'%" & rst1("phrase") & "%'"
With cmd1
.ActiveConnection = CurrentProject.Connection
.CommandText = _
"SELECT Count(*) FROM dec2007 " & _
"WHERE prob_summ LIKE " & str1
.CommandType = adCmdText
.Execute
End With
MsgBox ("The number of records that contain " & rst1("phrase") & _
" is " & int1)
I am not sure how to get the number of records found into the int1 variable.
Please Help.