i have a form that sends data
now when i check and compare between 2 values label1.caption and txt(1).text
and if label1.caption is bigger the txt(1).text then i cant send if its lower than i can.
i put a exit sub in the code but i cant figure out if its that or something else.
label1.caption number of customers in the list
txt(1).text remaining credit
it dosnt let me send the data
any help will be appreciated
best regards salsa31
now when i check and compare between 2 values label1.caption and txt(1).text
and if label1.caption is bigger the txt(1).text then i cant send if its lower than i can.
i put a exit sub in the code but i cant figure out if its that or something else.
label1.caption number of customers in the list
txt(1).text remaining credit
Code:
Dim SendToAll As String
For i = 1 To LsVw.ListItems.Count
If LsVw.ListItems(i).Checked And Len(Trim$(LsVw.ListItems(i).SubItems(1))) <> 0 Then
SendToAll = SendToAll & LsVw.ListItems(i).SubItems(1) & "; "
End If
Next
If SendToAll = vbNullString Then
MsgBox "you need to pick at least 1 customer from the list", vbExclamation
Check1.Value = 0
LsVw.SetFocus
Exit Sub
Else
If Val(Label1.Caption) > Val(Txt(1).text) Then
MsgBox "your credit balance does not allow to send to the number of customers that you chosen", vbExclamation
Check1.Value = 0
Exit Sub
ElseIf Val(Label1.Caption) < Val(Txt(1).text) Then
retval = sendsms(UserSmsUid, UserSmsUn, Txtmsg, SendToAll, Txt(5).text)
End If
End If
any help will be appreciated
best regards salsa31