[RESOLVED] FindNext temination
Please could someone help me understand how to terminate a loop using the FindNext method in VBA. I'm trying to search through sets of records in a recordset to add up some values when my search criteria are met, so want the FindNext loop to terminate when the search criteria are no longer met. I'm sure this is a very simple request but can't work out what to do. All pointers appreciated.
Thank you.
PHB
Re: [RESOLVED] FindNext temination
I should point out that Compute returns an Object reference because it can return different types. That means that with Option Strict On, which it should be, you would need to cast the result as its actual type, e.g.
vb.net Code:
Dim sum As Integer = CInt(myDataTable.Compute("SUM(Amount)", "[Date] = #1/01/2008#"))