Hi guys.
I have a question about declaring variables. I do a lot of re-querying
of controls in my database and I use the Set statement with a variable
set to the name of the control to tell the program which control to
requery. This makes it easy to requery controls on a different form.
However, up until today, I was dimming a new local variable for each
control I wanted to deal with ( E.G. Dim cbxctl as control) and then
setting that variable to the control I wanted to work with.
This works fine but it can be messy because you are dimming new
variables all over the place in your code. I thought it might be better
to declare all my variables in a global module. this cleans up the code
but it creates the problem that if I forget to use the set statement I
could end up updating the wrong control, unless I remember
to set each ctl to nothing.
Am I on the right track or should I stick to local variables.
thanks guys
Colin
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!