Please use a select case instead of nested "ifs" ! It will avoid you huge nesting problems. The syntax is :
Select Case condition
Case expression
Case expression
End Select
"condition" can be any valide expression : boolean, numeric, comparison
Tip : to have your code layout respected into your messages place it between tags PRE and /PRE, you could have a look at the page, How to write a message