I have a report in Access that someone else built and I need to update it but have very limited experience with VB. Here's the code:
This works fine on the report but only shows the sum of values that are associated with categoryID 302.Code:Public Function GetTotalUSEquity(strClient As String) As Double Dim rs As New ADODB.Recordset Dim dblTotalUSEquity As Double Set rs = cn.Execute("select sum(actamount) as TotalUSEquity from qryAccounts where Client = '" & strClient & "' and CategoryId = " & 302) Do While Not rs.EOF dblTotalUSEquity = rs("TotalUSEquity") rs.MoveNext Loop GetTotalUSEquity = dblTotalUSEquity End Function
I need this code to include the values of not only categoryID 302 but also 303, 304, and 305. Any idea how to add these categories into this code?
Thanks in advance.