I get an "Object variable or With block not set" error on the following code. I did a Debug Compile and it compiled without any errors.
What could be the problem?
What could be the problem?
Code:
Dim rs As DAO.Recordset
Set rs = db.OpenRecordset("SELECT Count([pkFilename]) AS RecCount FROM TblDocument where [fileName] = filename1;")
RecCount1 = rs![RecCount]
rs.Close
Set rs = Nothing