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

[RESOLVED] show customer Debts only if the record is "Not Paid"

$
0
0
i am trying to show a customer debth only if field in the table is "Not Paid"
i tried some codes cant figure this one alone
Code:


1) first Code
'Set rs = CN.Execute("SELECT * FROM Orders WHERE OrdBizStore= '" & FrmCusts.LsVw.SelectedItem.Text & "'")
'While Not rs.EOF
'If rs!OrdStatus = "Not Paid" Then
'    TxtDebt.Text = FormatCurrency(rs!OrdPrice)
'        rs.MoveNext
'        Wend

2) Second Code (it shows me the total of the payments not the Debts(if he has)
 Set rs = CN.Execute("select OrdPrice,OrdStatus from Orders where OrdBizStore = '" & RplS(FrmCusts.LsVw.SelectedItem.Text) & "'")
    If rs.EOF Then
        TxtDebt.Text = "0"
    Else
        TxtDebt.Text = FormatCurrency(rs!OrdPrice)
    End If

complicated syntax for me
any help will be appriciated
regards salsa31

Viewing all articles
Browse latest Browse all 21278

Trending Articles



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