Public Variables
"Pierre de Beer" wrote in message
...
Hi
I store the company name that is displayed on all my forms in a table. I
use
DLookup("[Company Name]", " Company Details") to retrieve the company name
from this table. Is it not better to retrieve the company name at startup
and store it to a global variable?
If the variable option is the best, how do I declare a global variable in
Access? I declare the variable in a module but can not get a value
assigned
to it.
As you can see I am new at this.
Kind Regards
Pierre
From what you describe, that sounds like a good candidate for a public
constant.
At the top of a module (not a form or report module):
Public Const CompanyName As String = "My Company Name"
I use this technique for version information that I want to appear on all of
my forms. Just change it in one place when necessary.
--
Randy Harris
tech at promail dot com
I'm pretty sure I know everything that I can remember.
|