In a module titled "Variables" I have declared a public variable TextAddr as a variant, on main form load I set this variable to 888 in other subs on the main form I use this variable and the value is there, later in my program I use a function located on a module titled "MotorControl" and in that function I also use my variable TextAddr, but at that time it's empty and I can not see why. If I move that entire funtion code to the main form then all is ok and the variable has the value but as soon as I move the code of the funtion off the main form the variable is empty.