
Don't Know How to Publicly Declare Variable
Follow-up: here is a more specific explanation of the
problem.
I did type in the following code, verbatim, as a new
module (general module, not a form module):
Function stdeclarevariables()
Public stDetail As Double, stHeader As Double,
stFontDetail As Double, stFontHeader As Double
End Function
Then, in a function that I had execute from a customized-
right click, a value was set to stFontHeader and, with a
MsgBox line of code to check & see that it retained its
value, it had.
But!!......
Right after that, I had it run another function. The line
to do this was
Call savecolorpreferences
It's a standard module as well.
In the savecolorpreferences routine, I used a MsgBox again
to check & see if the value was retained. Wouldn't you
know it? The variable had lost its value and was null
again.
Why!!!!! Grrr!!!!
LRH
Quote:
>-----Original Message-----
>I have Access 2000, and despite my knowledge base which
is
>pretty good I CANNOT figure out how to publicly declare a
>variable so that it is used throughout the entire
database.
>I have browsed all through Google, and CANNOT find a
>specific step-by-step procedure on how to do this. All I
>can find is "declare it in the modules" but I can't find
>**exact** syntax that is to be used. I have looked all
>over the place for it, but can't find it. And attempts to
>guess as it myself have proved fruitless.
>Any tips?
>LRH
>.