Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2005
    Posts
    23

    Unanswered: Global Variable: Holding a Variable after App Exit

    Is there any way to hold a global variable after program exit?

    'GLOBAL MODULE
    public myVar as integer

    'PROCEDURE
    myVar = 1

    Access is then exited and restarted. How do I hold myVar = 1 and not have it destroyed and set to Null upon restart?

    I thought of creating a table and holding the variable in the table. Wanted to know if anyone has developed a better system for doing this.

  2. #2
    Join Date
    Jan 2005
    Posts
    31
    Quote Originally Posted by bbsjoe
    Is there any way to hold a global variable after program exit?

    'GLOBAL MODULE
    public myVar as integer

    'PROCEDURE
    myVar = 1

    Access is then exited and restarted. How do I hold myVar = 1 and not have it destroyed and set to Null upon restart?

    I thought of creating a table and holding the variable in the table. Wanted to know if anyone has developed a better system for doing this.
    Option 2: Write it to a file.
    Option 3: Communicate with a second running process and store it there (this will require creating a second application and being able to communicate with it).
    Option 4: Write it to the registry.

    Frankly, the table option sounds best.

  3. #3
    Join Date
    Nov 2003
    Posts
    1,487
    I agree with Chris. Generally, larger DB's usually require some setup variables as well to be established and maintained. A secure table is one of the easiest ways to do this..
    Environment:
    Self Taught In ALL Environments.....And It Shows!


  4. #4
    Join Date
    Aug 2005
    Posts
    23

    Thumbs up

    Thank you chris and cyberlynx.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •