Need to use public value across standard modules

arage

Registered User.
Local time
Today, 10:42
Joined
Dec 30, 2000
Messages
537
Need to use public value across standard modules
I declared a public variable in a standard code module & need to reference this value in another standard module, how can I do that? Possible?
 
A Public Variable is just that Public.

This means from a Module Standpoint (not a form or report module which is actually a class module) you can reference the Public variable simply by using it in code.

For Public Variables in a Class Module need to have their reference point also identified (which means they have to be activated) in order to reach those variables. Example the Form "MyForm" needs to be open to see the Public variables declared in its Declaration section: Using Forms![MyForm].[Public Variable Name].

HTH
 
I get a “variable not defined” error when my standard module tries to access a variable defined as public in some other standard module in the same database.
 
oh I get it, I didn’t comment out option explicit in the module.
 

Users who are viewing this thread

Back
Top Bottom