From
MSDN:
Creating or Saving Application Settings
You can use the SaveSetting statement to save a new value for a registry key stored in your application's registry location. For example, you could add code to the Form_Unload event in the application's main form in order to preserve settings at shutdown, or in the Form_Unload event on an Options dialog box to update user preferences.
Use the following syntax for the SaveSetting statement:
SaveSetting appname, section, key, value
The following code saves new values for the Backup and LastEntry keys in the Startup section of the registry for an application named "RegCust." This code assumes that the variables strDate and intLastEntry contain the new values.
Private Sub Form_Unload(Cancel As Integer)
SaveSetting "RegCust", "Startup", "Backup", strDate
SaveSetting "RegCust", "Startup", "LastEntry", _
intLastEntry
End Sub
Retrieving Application Settings
You can use the GetSetting and GetAllSettings functions to retrieve registry values stored in your application's registry location. For example, your application can retrieve registry settings to recreate its condition at the time it was closed.
One Setting at a Time
To retrieve a single registry setting, use the following syntax for the GetSetting function:
GetSetting(appname, section, key[, default])
The following code retrieves the value of the LastEntry key in the "RegCust" application's Startup section, and displays the value in the Immediate window.
Private Sub Form_Load()
Dim intLastEntry As Integer
intLastEntry = GetSetting("RegCust", "Startup", _
"LastEntry", "0"

Debug.Print intLastEntry
End Sub
Note that you can use the optional parameter, default, to set the value returned by Visual Basic when there is no value listed in the registry for the specified key.
To get what you want, you have to go through the crap, but to get through the crap you have to know what you want... ![[rockband] [rockband] [rockband]](/data/assets/smilies/rockband.gif)