I have 12 textboxes in a form. Box 1-8 = 77050; Box 9=77050; Box 10=77050; Box 11=77050; Box 12=77050. This is my code for these textboxes:
ElseIf ((([A9] + [A10] + [A11] + [A12] + [A13] + [A15] + [A16] + [A24]) <> [A8]) Or ([A8] <> [E49]) Or ([A8] <> [E12]) Or ([A8] <> [A23])) Then
A9.Visible = True
A10.Visible = True
A11.Visible = True
A12.Visible = True
A13.Visible = True
A15.Visible = True
A16.Visible = True
A23.Visible = True
A24.Visible = True
A8.Visible = True
E12.Visible = True
E49.Visible = True
CumEmpHrs.Visible = True
Line207.Visible = True
BoxA9.Visible = True
All boxes were true, meaning the computer thinks the numbers do not equal. So I put this code in before the above code:
'ElseIf ([A9] + [A10] + [A11] + [A12] + [A13] + [A15] + [A16] + [A24]) = 77050 Then
' MsgBox "It adds up"
'ElseIf [A8] = 77050 Then
' MsgBox "A8 adds up"
'ElseIf [A23] = 77050 Then
' MsgBox "A23 adds up"
'ElseIf [E12] = 77050 Then
' MsgBox "E12 adds up"
ElseIf [E49] = 77050 Then
MsgBox "E49 adds up"
Then I tested each one. All came up with the MsgBox that it adds up. So why does the ElseIf formula not work; in other words, why does it all become visible instead of going onto the next ElseIf. The above code is in the middle of a bunch of other ElseIf statements which are coded the same way, but are working.
Appreciate any help. Janet Lyn
ElseIf ((([A9] + [A10] + [A11] + [A12] + [A13] + [A15] + [A16] + [A24]) <> [A8]) Or ([A8] <> [E49]) Or ([A8] <> [E12]) Or ([A8] <> [A23])) Then
A9.Visible = True
A10.Visible = True
A11.Visible = True
A12.Visible = True
A13.Visible = True
A15.Visible = True
A16.Visible = True
A23.Visible = True
A24.Visible = True
A8.Visible = True
E12.Visible = True
E49.Visible = True
CumEmpHrs.Visible = True
Line207.Visible = True
BoxA9.Visible = True
All boxes were true, meaning the computer thinks the numbers do not equal. So I put this code in before the above code:
'ElseIf ([A9] + [A10] + [A11] + [A12] + [A13] + [A15] + [A16] + [A24]) = 77050 Then
' MsgBox "It adds up"
'ElseIf [A8] = 77050 Then
' MsgBox "A8 adds up"
'ElseIf [A23] = 77050 Then
' MsgBox "A23 adds up"
'ElseIf [E12] = 77050 Then
' MsgBox "E12 adds up"
ElseIf [E49] = 77050 Then
MsgBox "E49 adds up"
Then I tested each one. All came up with the MsgBox that it adds up. So why does the ElseIf formula not work; in other words, why does it all become visible instead of going onto the next ElseIf. The above code is in the middle of a bunch of other ElseIf statements which are coded the same way, but are working.
Appreciate any help. Janet Lyn