During some testing of some un-related functions, those
public variables became empty, i.e., "". At one of the points
where that became apparent, I inserted a MsgBox statement
to print out the current values of a few of them only to discover
they were in fact empty.
What could cause public variables to suddenly become empty?
Thanks,
Bill
Of course, the variables do not survive once you have closed the program, so
the best idea might be to write them to a table, and then read them from
there as needed instead of using public variables.
If you do not need them to survive between sessions, you might leave a form
open and hidden, and read the values from the form when needed. Typically
this would be the form where the user enters the original values.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Bill" <sta...@jps.net> wrote in message
news:qZJ5e.3041$An2...@newsread2.news.pas.earthlink.net...
The values involved here are indeed stored in a single
table record. When the application starts, that record
is read and the public variables are set accordingly.
I'll continue with development activity and keep a watch
for any further "corruptions".
Thanks,
Bill
"Allen Browne" <Allen...@SeeSig.Invalid> wrote in message
news:ufFaXrMP...@TK2MSFTNGP10.phx.gbl...
Then test this one, and reinitialize if necessary before using the others:
If Not gbInitialized Then
Call Init()
End If
'use your variable
Eventually gave up on using public variables like this, finding it was
easier to just grab the value when needed.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Bill" <sta...@jps.net> wrote in message
news:wkU5e.3344$lP1....@newsread1.news.pas.earthlink.net...
The references to the public variables in my application are
frequent and many. For that reason, I didn't even consider
anything that might be somewhat involved each time I needed
to make use of those values. However, I'm always willing to
learn better ways of doing things.
Thanks,
Bill
"Allen Browne" <Allen...@SeeSig.Invalid> wrote in message
news:e0iGBFY...@TK2MSFTNGP15.phx.gbl...
If you need lots of values from a table at once, and performance is an
issue, opening one SQL statement to get them all will be much more
efficient.
If the lookups are very frequent, I use controls on a hidden form to hold
the values, though personally I don't do this often. You may already have a
hidden form open to simulate an application close event, or to run an
application wide timer, or to hold info about the user who logged in.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Bill" <sta...@jps.net> wrote in message
news:Uz26e.3504$An2...@newsread2.news.pas.earthlink.net...
Thanks for your time and help.
Bill
"Allen Browne" <Allen...@SeeSig.Invalid> wrote in message
news:%23wQeLbb...@TK2MSFTNGP14.phx.gbl...