Paste the code below into the indicated subs of the .dvb you supplied. It
will save the contents of first two text boxes to the registry each time the
contents of the text boxes are updated. I chose the "AfterUpdate" event, it
could be a different event if you like.
The values that are saved to the registry will be loaded into the "TL" &
"skh" text boxes each time the "Pvessel" form is activated. You could also
choose a different way to do that ... maybe a "Refresh" button instead of
"UserForm_Activate"
I chose the following names for the "GetSetting" & "SaveSetting" functions.
They can be almost anything. Use whatever makes the most sense to you or
your successor.
appname = "Pvessel_App"
section = "SU_Defaults" (Startup defaults)
key = The name of the textbox with "_Textbox" appended
default = equals the values you had displayed on your form
Private Sub UserForm_Activate()
Me.TL.Text = GetSetting(appname:="Pvessel_App", section:="SU_Defaults",
key:="TL_Textbox", Default:="1130")
Me.skh.Text = GetSetting(appname:="Pvessel_App", section:="SU_Defaults",
key:="skh_Textbox", Default:="1000")
End Sub
Private Sub TL_AfterUpdate()
SaveSetting "Pvessel_App", "SU_Defaults", "TL_Textbox", Me.TL.Text
End Sub
Private Sub skh_AfterUpdate()
SaveSetting "Pvessel_App", "SU_Defaults", "skh_Textbox", Me.skh.Text
End Sub