Sep 27, 2007 #1 jay2502 Technical User Apr 20, 2007 25 A2 I have a variable in vba but it defults to zero when i start the database everytime how can i get the database to save it when it closes.
I have a variable in vba but it defults to zero when i start the database everytime how can i get the database to save it when it closes.
Sep 27, 2007 #2 lespaul Programmer Feb 4, 2002 7,083 US you will need to store the value in a table or external text file. Write out when you close the program and read in when you start the program. Leslie Essential for database developers: The Fundamentals of Relational Database Design Understanding SQL Joins Upvote 0 Downvote
you will need to store the value in a table or external text file. Write out when you close the program and read in when you start the program. Leslie Essential for database developers: The Fundamentals of Relational Database Design Understanding SQL Joins
Sep 27, 2007 Thread starter #3 jay2502 Technical User Apr 20, 2007 25 A2 How would I Write out and read in the variable? Just an example please Upvote 0 Downvote
Sep 27, 2007 1 #4 maxhugen Programmer May 25, 2004 498 AU I use a table that I call "_system", which is stored in the front end. Its like a hash table, or the Windows Registry. Fields are: sysGroup optional, helps group similar items. sysItem A name to look up, eg "MySavedVariable" sysValue The value of the item, eg "MyVariableValue" Now you can save the value of your variable in the table, and retrieve as required. An alternative is to save it to the Registry itself, see GetSetting and SaveSetting methods in Help. Max Hugen Australia Upvote 0 Downvote
I use a table that I call "_system", which is stored in the front end. Its like a hash table, or the Windows Registry. Fields are: sysGroup optional, helps group similar items. sysItem A name to look up, eg "MySavedVariable" sysValue The value of the item, eg "MyVariableValue" Now you can save the value of your variable in the table, and retrieve as required. An alternative is to save it to the Registry itself, see GetSetting and SaveSetting methods in Help. Max Hugen Australia