Unanswered: Store the results of a query in a variable?
Obviously the code below does not work... But it is what I need to be able to do. Is there a way??
"strResult = db.Execute strSQL ', dbFailOnError" is the line that is wrong. How can I run the query and store the returned value in a variable?
Dim db As DAO.Database
Dim strSQL As String, strStatus As String, User As String, strResult As String
User = CurrentUser
strStatus = "Completed"
strSQL = "SELECT Count(*) AS Expr1 FROM Feedback WHERE (((Feedback.Author)='" & User & "') AND ((Feedback.Status)= '" & strStatus & "'));"
Set db = CurrentDb
strResult = db.Execute strSQL