Hello, I need to save the value of an integer in the registry and upon the form load call that value back through GetSetting and SaveSetting. Everything seems to be working fine until I try to modify it in the form. I should be able to load it up with a value and pressing a button would multiply the existing value by 5. However the code I have so far keeps returning 0 when I try to multiply. This is my code so far:
I cannot figure out why this is so. All my registry values appear to be correct. Any help would be appreciated. Thanks!
Code:
Option Explicit
Public dVal As Integer
Private Sub cmdM_Click()
dval = dval * 5
End Sub
'''''''''
Private Sub Form_Load()
Ransom = GetSetting("TT1", "TT1", "Val", 50)
LV.Caption = dVal
End Sub
Private Sub Form_Unload(Cancel As Integer)
SaveSetting "TT1", "TT1", "Val", dVal
End Sub