Here, try this.
This uses the registry to save the value of Text1 on form unload and then retrieves it from the registry and loads the text box on form load.
Private Sub Form_Load()
Text1 = GetSetting(App.Title, "Properties", "Settings", "")
End Sub
Private Sub Form_Unload(Cancel As Integer)
SaveSetting App.Title, "Properties", "Settings", Text1.Text
End Sub
|