ProjectExplorer
Programmer
I need to return the Count and Sum of a query in VBA.
i.e.
Dim Db as DAO.Database
Dim rst as DAO.Recordset
Dim SQL as string
Dim Total as Integer
SQL = "SELECT SUM (etc. Etc)" ....with paramters taken from a form text boxes.
Set Db = CurrentDb
Set rst as Db.OpenRecordset(SQL, DbOpenDynaset)
How do I run this query and just return the SUM (i.e. a so called scalar query that just returns the SUM value)so I can apply it to the Total variable.
Total = ?????????
Any help much appreciated.
Thanks
i.e.
Dim Db as DAO.Database
Dim rst as DAO.Recordset
Dim SQL as string
Dim Total as Integer
SQL = "SELECT SUM (etc. Etc)" ....with paramters taken from a form text boxes.
Set Db = CurrentDb
Set rst as Db.OpenRecordset(SQL, DbOpenDynaset)
How do I run this query and just return the SUM (i.e. a so called scalar query that just returns the SUM value)so I can apply it to the Total variable.
Total = ?????????
Any help much appreciated.
Thanks