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.
07-27-2007, 12:14 PM
I found my problem.
I guess I just needed some one to listen.
Thanks for being there.
07-27-2007, 01:54 PM
Post what you did.
It may help someone else with a 'funny variable'.
07-27-2007, 02:13 PM
The root of my problem is that I agreed to make some changes to someone elses program and that someone else is a much higher level programer then I. He had a text box named TextAddr (that I was not aware of) and in his program and he was using a statement like "TextAddr = 123" in his program code, so I looked at that statement and thought that it was a variable that was being set to the value of 123.
I dident know that when you put a value in a text box you dont have to say "frmMain.TextAddr.Text = 123" but you can simply say "TextAddr = 123" provided you do it in code that's located on the same form as the text box.