PDA

View Full Version : Variables not stored globally?



nyteflyte
06-17-2007, 06:27 PM
hey guys, me again, im almost done writing this application but the problem is is that the value of my variable nummarks is not being used globally. it simply gets set back to 0. attached is my program. help would be muy bien

mikerickson
06-17-2007, 06:42 PM
It is declared in a userform's code module. It will go to zero when the userform is unloaded.

nyteflyte
06-17-2007, 06:44 PM
is there a way i can still do it? because i need to unload the form so that i can write stuff in the cells.

geekgirlau
06-17-2007, 07:02 PM
You don't need to unload the user form first - populate your cells, then unload the form.

mikerickson
06-17-2007, 08:05 PM
All of your code is in the userforms code module, if the UF is unloaded, your code doesn't run.

Bob Phillips
06-18-2007, 12:26 AM
I don't get it. You create the table. You can add values okay. Whyt do you need to get the variable afterwards?

and the average calculation is a bit awry.

unmarkedhelicopter
06-18-2007, 12:58 AM
I'm quicker than Tristan and he's older.l

Yeah ! but you're slower than Speedy ... and he's only a mouse ...