After updating a textbox, I am attempting to run this code to update a seperate textbox:
Dim dbs As Database, rst As DAO.Recordset
Set dbs = CurrentDb
Set mtd = Me.MTDhrs
Set rst = dbs.OpenRecordset("SELECT Sum(Ahrs)+Sum(Bhrs)+
Sum(Chrs) AS Expr2 FROM Production
WHERE (((DatePart('m',[proddate]))=Month(Now())));")
mtd.Value = rst("Expr2")
----------
I get Run-time error '2448' (You can't assign a value to this object).
Dim dbs As Database, rst As DAO.Recordset
Set dbs = CurrentDb
Set mtd = Me.MTDhrs
Set rst = dbs.OpenRecordset("SELECT Sum(Ahrs)+Sum(Bhrs)+
Sum(Chrs) AS Expr2 FROM Production
WHERE (((DatePart('m',[proddate]))=Month(Now())));")
mtd.Value = rst("Expr2")
----------
I get Run-time error '2448' (You can't assign a value to this object).