This is a scoping problem. When you have the same name declared in a class module and a general module and you open the form for that particular class module, the variable in the class module is considered local (i.e. closer to) the code that references it. Access - like most languages I know using the "separate module" concept - uses a "scope" or "visibility" rule that says "closest reference wins."
If you are in a class module OTHER than the one that contains the declaration of that variable, the more distant reference wins. Note, however, that there is such a thing as a "friend" declaration for a variable that allows you to qualify your reference to an explicit class module and reference it from another place.
As many of my colleagues have noted, when you have duplicate names (and don't qualify the reference), you get the closest one, which is usually the local definition. So the variable that got updated was in scope when you set it to something other than zero, but when the subroutine exited, it went out of scope and the public variable hadn't been modified away from zero, so that's what you saw.