G
Guest
Hello, I am in need of some help. I am using Access 97 and I am currently
building a module. The module is looking at a table (name:14_Table) and
pulling certain criteria and placing the data into a template in excel. The
criteria I am pulling is using a OpenRecordset function: (my code example)
Dim rst As Recordset
strSQL = ("SELECT * FROM 14_Table WHERE FACILITY_GROUP = 'Baptist'
AND" & " LAG >=0 And LAG <=15")
Set rst = CurrentDb.OpenRecordset(strSQL)
If rst.RecordCount = 0 Then
.Range("C23").Value = "0"
Else
rst.MoveLast
.Range("C23").Value = rst.RecordCount
EndIf
Ok, that is how I am pulling criteria for a count of total records and
placing them in a excel template. Now the question is, how can I create
another recordset type code to pull the SUM of the field "TOTAL_BILLED" from
those records the above code pulls??? Any ideas?
building a module. The module is looking at a table (name:14_Table) and
pulling certain criteria and placing the data into a template in excel. The
criteria I am pulling is using a OpenRecordset function: (my code example)
Dim rst As Recordset
strSQL = ("SELECT * FROM 14_Table WHERE FACILITY_GROUP = 'Baptist'
AND" & " LAG >=0 And LAG <=15")
Set rst = CurrentDb.OpenRecordset(strSQL)
If rst.RecordCount = 0 Then
.Range("C23").Value = "0"
Else
rst.MoveLast
.Range("C23").Value = rst.RecordCount
EndIf
Ok, that is how I am pulling criteria for a count of total records and
placing them in a excel template. Now the question is, how can I create
another recordset type code to pull the SUM of the field "TOTAL_BILLED" from
those records the above code pulls??? Any ideas?