Kind of sounds like you're declaring the variable in a sub, setting it to 0, then it gets discarded when the method call is done. If you declare it static then you will not be able to change it directly. Another thing to check for, if you did declare that variable globally (at the top of your source, outside any sub's) then look to see if you declare a variable with the same name inside the sub you're setting it with, because it will set the one inside to the value while never touching the other unless you have some way of referencing it (not sure how in VB, I try to avoid this scenario most times and I'm more of a c++ guy). And yes, please show us the source, most people who know the language can point out simple flaws right away when they see them.

Oh and this isn't site related... post in the right forum next time