Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21301

[RESOLVED] program stucks on while not

$
0
0
i have a code to check if a status is " Not Paid" in the table then it will SUM it
the problem is its stucking every time i open this form
Code:

Private Sub Form_Activate()
 Set rs = CN.Execute("SELECT * from Orders")
 Do While Not rs.EOF
If rs!OrdStatus = "Not Paid" Then
 Set rs = CN.Execute("SUM(OrdPrice) as SumQ FROM Orders")
    If rs.EOF Then
        LblPayments.Caption = 0
    Else
        LblPayments.Caption = FormatCurrency(rs!SumQ)
    End If
End If
Loop
End Sub

i am trying to SUM the cash from the table only if the OrdStatus is "Not Paid"
what i am missing here?
what i am doing wrong?

Viewing all articles
Browse latest Browse all 21301

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>