I just got it to work.
I moved it inside of my loop and now it works.
I was just about to delete this post.
thanks for the quick reply
I think the problem was that some of my controls were not Integer values (even through my variable type was), so it was throwing off the code, but when I...