Do While Not rs.EOF
    If Not rs.BOF Then
        If rs.Fields(5) <> Null Then
            c = c + rs.Fields(5)
        End If
        If rs.Fields(6) is not nullThen
            d = d + rs.Fields(6)
        End If
        If rs.Fields(7) <=null Then
           a = a + rs.Fields(7)
        End If        b = b + rs.Fields(3)
    End If
    rs.MoveNext
Loop