C
Chris Nebinger
The concept is right, you just need a little bit more:
strSQL = "Select Sum(Amount) As TotalSum from
tblGMISDrawdown where BlockGrantIntID = " &
Me.cboSelectBlockGrant.Column(0)
'Okay, no open the Recordset:
Set rst = db.OpenRecordset(strSQL, dbOpenDynaset)
'The results can be accessed by using rst("FieldName")
strResult = rst("TotalSum")
Debug.Print " Total is " & rst("TotalSum")
Chris Nebinger
Me.cboSelectBlockGrant.Column(0)
strSQL = "Select Sum(Amount) As TotalSum from
tblGMISDrawdown where BlockGrantIntID = " &
Me.cboSelectBlockGrant.Column(0)
'Okay, no open the Recordset:
Set rst = db.OpenRecordset(strSQL, dbOpenDynaset)
'The results can be accessed by using rst("FieldName")
strResult = rst("TotalSum")
Debug.Print " Total is " & rst("TotalSum")
Chris Nebinger
tblGMISDrawdown where BlockGrantIntID = " &-----Original Message-----
Hi,
I need to have the sum of a query first set in a variable and then to display it.
I got the following code which is not working as I believe, my concept is not
correct. I am looking for any help on this. Thanks in advance.
Dim db As DATABASE
Dim rst As Recordset
Dim strSQL As String
Dim strResult As String
Set db = CurrentDb
strSQL = "Select Sum(Amount) As TotalSum from
Me.cboSelectBlockGrant.Column(0)