I'm new to this stuff so forgive what is probably an easy question. I'm using the following statement in the General section of the module for Form1:
Public iID As Integer
The iID variable eventually gets set to a number. When I open Form2 and try and populate a text field with the value held by the iID variable all I get is 0. I've used a series of msgboxes to determine that the variable stays set for as long as Form1 is open, but when Form1 is closed the variable gets reset to 0. I've worked around this "problem" by using code to make Form1 invisible, which keeps iID holding the number, but I thought Publicly declared variables were supposed to hold their value even after the form that called them was closed.
Am I understanding Public declarations correctly? Thanks for any guidance!
Public iID As Integer
The iID variable eventually gets set to a number. When I open Form2 and try and populate a text field with the value held by the iID variable all I get is 0. I've used a series of msgboxes to determine that the variable stays set for as long as Form1 is open, but when Form1 is closed the variable gets reset to 0. I've worked around this "problem" by using code to make Form1 invisible, which keeps iID holding the number, but I thought Publicly declared variables were supposed to hold their value even after the form that called them was closed.
Am I understanding Public declarations correctly? Thanks for any guidance!