On the following code I want to attribute the value of the sum([price]) to an variable called txtFullPrice:
Is there anybody that could help me please.
Dim dbs As Database, rst As Recordset
Dim strcriteria As String
'return reference to current database
Set dbs = CurrentDb
'Define serach criteria
strcriteria = "SELECT SUM([Price]) FROM tblRBS WHERE [USERID]='" & FOSUsername & "'"
'Create a dynadet-type Recordset object based on tblUser table
Set rst = dbs.OpenRecordset(strcriteria)
rst.Movelast
*******
'close connection on tblUser table
rst.Close
Set dbs = Nothing
This Forum have been helping me to improve my skills a lot. Thanks to everyone.
Jony Bravo
Is there anybody that could help me please.
Dim dbs As Database, rst As Recordset
Dim strcriteria As String
'return reference to current database
Set dbs = CurrentDb
'Define serach criteria
strcriteria = "SELECT SUM([Price]) FROM tblRBS WHERE [USERID]='" & FOSUsername & "'"
'Create a dynadet-type Recordset object based on tblUser table
Set rst = dbs.OpenRecordset(strcriteria)
rst.Movelast
*******
'close connection on tblUser table
rst.Close
Set dbs = Nothing
This Forum have been helping me to improve my skills a lot. Thanks to everyone.
Jony Bravo