vba - Access the Tag property of an unloaded MS-Access form -


i'm sort of new ms-access & vba programming. have developed multi-user application in ms-access 2016 , vba , converted accdb.

i need value stored in tag property of each form create. forms not loaded, need value module superuser of application can grant/remove user's access particular form. right i'm using form's name instead, form's name doesn't give same level of detail can store in tag property.

is there way can access/get tag property value of unloaded form?

disclaimer: i'm not familiar ms-access @ all.

a form class module, , class module nothing "blueprint" object - it's type.

when interact form, you're interacting instance of form - object. true when don't create instance (using new keyword), because forms have special attribute (which can see if export module , view in favorite text editor), vb_predeclaredid, set true - makes vba create global/default instance you, object that's named after type.

so when assign myawesomeform.tag, you're working default instance - object, not type. potentially confusing, because vba names object type.

because instance global, , managed vba, can this:

myawesomeform.tag = "abc" unload myawesomeform debug.print myawesomeform.tag 'should print nothing, won't crash either 

merely accessing tag property of unloaded global instance load object!

and takes question:

is there way can access/get tag property value of unloaded form?

absolutely not. because you'll load instance of form accessing tag property. , empty, because whatever value set before set on another object of same type.

tag instance property: belongs instance, not form type. means can have this:

myawesomeform.tag = "123"  dim form1 myawesomeform set form1 = new myawesomeform form1.tag = "abc"  dim form2 myawesomeform set form2 = new myawesomeform form2.tag = "xyz"  debug.print myawesomeform.tag 'prints 123 debug.print form1.tag 'prints abc debug.print form2.tag 'prints xyz 

an object "loaded" when it's "in memory". object isn't in memory, doesn't exist; no, can't read or write property value "unloaded" form.

a form can loaded not displayed though. if that's meant, answer "yes, absolutely!".


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -