You're trying to assign rs, which is a recordset
object, to "finalcount", which apparently isn't
even declared. (You have a "finaldate".) I
recommend you put "Option Explicit" in the declarations
section of your module to force declaration of all
variables.
You didn't mention you were trying to do this in code.
Since you've got a recordset object, you can get the
count from its RecordCount property, no need for SQL.
Code:
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("tblCustomers")
cmdUpdate.Caption = rs.RecordCount
rs.Close
db.Close
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.