A couple of things, I don't see any code that calls "Sub Login"
Try putting a Break Point at this line "If arrUsernames(loopIndex) = username Then", then you can check the values and you should have a better picture of what's going on.