I am setting up a module to move all of my supporting code to (from my form). I am seeing something strange. First off, I am wanting to create some globa variables in this module to use throughout. These include the following variables:
frm as form
lb_MkSg as Control
lb_SoldTo as Control
I have these in the General Declarations of my module.
Also, I set the value for the variables using the following text:
Set frm = Forms("FormName")
Set lb_mksg = frm("lb_mksg")
Set lb_SoldTo = frm("lb_SoldTo")
The two controls are listboxes with the respective names. Now I am having problems accessing these controls through my code. In my Subs in my module, when I type in the control such as lb_mksg to access my items within the control (ie. lb_mksg.column), I get none of the elements for this control. Have I decalred the variables properly? Funny thing is, within my sub, I can attempt to re-establish the reference to the control using the same code and I get the same response; however, if I remove the instance of this control from my Declarations section, my reference in the Sub will then work. The problem with this, won't I have to then declare these variables in each of the subs I that I would like to use them in? I would prefer to declare them once and that be it.