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

[RESOLVED] how do i count a value in access only if it contains the work "OK" and show the total

$
0
0
how do i count a value in access only if it contains the work "OK" and show the total in a textbox

e.x

i have 5 field called status
1 field name is "Denied"
and 4 fields name is "ok"
if 4 fields name is "ok" then it will count 4 and show the number 4 in a text box
i tried some code but it get stuck the program all the time

Code:

Private Sub Form_Activate()
Set rs = CN.Execute("SELECT SmsStatus from TizmonSms where ID=" & FrmTizmonim.LsVw.SelectedItem.Tag)
While Not (rs.EOF And rs.BOF)
    Select Case rs![SmsStatus]
        Case "ok"
TxtWaitToBeSent.Text = rs!SmsStatus
     

rs.MoveNext
Wend
'rs.Close
'End If
End Select
End Sub

i want to count only status that the name is "ok" and display the total in a textbox

any help will be appreciated
regards salsa31

Viewing all articles
Browse latest Browse all 21090

Trending Articles



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