Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / April 2005

Tip: Looking for answers? Try searching our database.

public variables

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Megan - 13 Apr 2005 11:12 GMT
hi.
i have a default year variable defined in a public module.
i get the value from a table on login.
i display the value when i'm in the customer form so i know what year the
prices are for.
if i do i lookup for prices for the default year and none exist, my value
gets erased. or when navigating thru customer records.
i don't understand why.
i'm not re-assigning it anywhere.
any ideas?

i have other public values - for instance, the user's access level, and
that never disappears.

thanks!
Graham Mandeno - 13 Apr 2005 23:13 GMT
Hi Megan

It seems strange that one but not all of your public variables should
disappear.

Resetting your code will call ALL public variables to be reset to their
ininitialised values.  This can happen if you have an unhandled error which
comes up with the "Debug or End" dialog message.  If you click End then your
code will be reset.

Are you sure that is not what is happening?

Otherwise, the only way to change the value of a public variable is to do so
explicitly in code.

Some people prefer to use textboxes on a hidden form instead of public
variables because they do not disappear when VBA is reset, but so long as
your error handling is robust, this should not be necessary.
Signature

Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

> hi.
> i have a default year variable defined in a public module.
[quoted text clipped - 11 lines]
>
> thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.