Code:' Saving data to the Registry ' Private Sub Form_Load() Label1.Caption = "Registry: Save to, Load from Registry" Command1.Caption = "Save" Command2.Caption = "Load" End Sub Private Sub Command1_Click() ' Save to Registry ' VB and VBA Program Settings Call SaveSetting("Demo2007", "values", "text1", Text1.Text) End Sub Private Sub Command2_Click() ' Loading, retrieving data from "VB and VBA program Settings" Text2.Text = GetSetting("Demo2007", "values", "text1", "2007-1") ' if the value at "Demo2007" sub "values" sub "text1" ' Text2.Text equals the default value of "2007-1" End Sub




Reply With Quote