Page 1 of 1

For each

Posted: Tue Jan 02, 2018 9:05 am
by Dummy1912
Hello,

and Happy newyear for everybody

I like to check my controls if none has the text 'Uncleared'
so all the controls need to have the text 'Cleared' before we can close the account
but when i use my code it still manage to lock the account :(

anyone please?
Code: Select all
For Each c As Control In UiGroupBox2.Controls
If (TypeOf c Is UiSummary) Then
If Not CType(c, UiSummary).txtstatus.Text = "Cleared" Then
 Exit Sub
                    Else
                        If TransToMy() Then 
                            SummaryPrevButton.txtstatus.Text = "Cleared"
                            SummaryPrevButton.Refresh()
                        End If
                        Exit Sub
                    End If
                End If
            Next c
Thanks

Re: For each

Posted: Wed Jan 03, 2018 2:41 pm
by CodenStuff
Your code looks good.

Have you checked for case sensitivity?

Also try in reverse: IF text = "uncleared" THEN do this ELSE this

Re: For each

Posted: Wed Jan 03, 2018 3:10 pm
by Dummy1912
Hello,

Ooh that sound good,
but yes the case sensitivity is correct and still not working...

any ideas please