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
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
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
any help will be appreciated
regards salsa31