Can someone give me some advice on coding a VB program so that values can be saved, and reappear when the program is reopened? This would also apply to coding a program so that you can set default values so the user can customize the application.
You can use the Windows registry. Look into SaveSetting and GetSetting in the MSDN dcumentation.
GetSetting Function
Returns a key setting value from an application's entry in the Windowsregistry.
Syntax
GetSetting(appname, section, key[, default])
The GetSetting function syntax has thesenamed arguments:
Part Description
appname Required.String expression containing the name of the application or project whose key setting is requested.
section Required. String expression containing the name of the section where the key setting is found.
key Required. String expression containing the name of the key setting to return.
default Optional.Expression containing the value to return if no value is set in the key setting. If omitted, default is assumed to be a zero-length string ("").
Remarks
If any of the items named in the GetSetting arguments do not exist, GetSetting returns the value of default.
SaveSetting Statement
Saves or creates an application entry in the application's entry in the Windowsregistry.
Syntax
SaveSetting appname, section, key, setting
The SaveSetting statement syntax has thesenamed arguments:
Part Description
appname Required.String expression containing the name of the application orproject to which the setting applies.
section Required. String expression containing the name of the section where the key setting is being saved.
key Required. String expression containing the name of the key setting being saved.
setting Required.Expression containing the value that key is being set to.
Remarks
An error occurs if the key setting can’t be saved for any reason
Thanks in Advance!
TRIP85
In the game of life, it's not whether you win or lose, it's how drunk you get.
-Homer Simpson
Thanks, Trip85. I did try the GetSetting and SaveSetting once and I couldn't get it to work. I'll give it another look over and see if I can find where I made the mistake.