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

[RESOLVED] How to check if a customers has a remaining Treatments VIA rs.BOF And rs.EOF

$
0
0
i am trying to check if a customers has treatments left from a table and if not then
no msgbox how ever if a customer has 2 treatments then msgbox is displayed

e.x
customer name ,david, Treatment name, HairCut remain 0
customer name, david ,Treatment name ,Nails remain 5

i did a loop used rs.BOF And rs.EOF but still he skips the customers name that has treatments left why?
what is missing in my code?
Code:

Set rs = CN.Execute("select SubTreatment,SubRemain from Subscribers WHERE SubCust='" & RplS(txtSubject.text) & "'")
      While Not rs.BOF And rs.EOF
      If rs!SubRemain > 0 Then
      MsgBox "This Customer has Treatments left " & rs!SubTreatment
      Exit Sub
      End If
      rs.MoveNext
      Wend

tnx in advanced
salsa31

Viewing all articles
Browse latest Browse all 21246

Trending Articles



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