| 1): Dim a string in the private section of your form: Private BeginValueForm as string 2): If the form is loaded and ready to use then call the functon: BeginValueForm = StartValues(Me) 3): in the event form_unload use the code If BeginValueForm <> StartValues(Me) Then 'Save data....... end if ============================================================ Public Function StartValues(ByVal frm As Form) As String 'Add your own controls to the list. Dim ctrl As Control Dim x As Long For Each ctrl In frm.Controls If TypeOf ctrl Is TextBox Or TypeOf ctrl Is ListBox Or TypeOf ctrl Is ComboBox Then StartValues = StartValues + ctrl.Text ElseIf TypeOf ctrl Is OptionButton Or TypeOf ctrl Is CheckBox Then StartValues = StartValues + CStr(ctrl.Value) ElseIf TypeOf ctrl Is ListBox Then For x = 0 To ctrl.ListCount StartValues = StartValues + ctrl.List(x) End If Next x Next End Function |
Save the changes made by the user on your forms |
Express News India | Freelance ecommerce web development India