Jobs
Author: crimson/hunter Date Submitted: 9/27/2007 Category: Database Compatibility: .NET,VB 6 This code has been accessed 3742 times.
Email Yourself this snippet:
No declarations
Code
rs.Open "colector", con, adOpenDynamic, adLockOptimistic rs.MoveFirst If rs.BOF = True Then Label1.Caption = .Fields("principal") 'store the 1st row Else Label2.Caption = 0 'return the 2nd storage to 0 Label2.Caption = val(Label1.Caption) 'pass value to 2nd storage While Not rs.EOF Label2.Caption = val(Label2.Caption) + val(rs!principal) 'add the remaining value in the selected field rs.MoveNext Wend End If rs.Close