Hello,
This is good solution but user could edit data, then decide to restore
original values ( manual ) and your script will tell him that there is a
change.
other solution is keeping all data in private variables and in a function on
the end just make comparison for each control.
and if there is change then ask user what to do
good luck
Galin Iliev
MCSD, MCAD.NET
"Alex Levi" <Al******@discussions.microsoft.com> wrote in message
news:98**********************************@microsof t.com...
You can make one sub that contain all of this code:
Private myDataCh as Boolean = False
Private Sub myDataChanged(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles TextBox1.TextChanged, _
TextBox2.TextChanged, CheckBox1.CheckedChanged
myDataCh = True
End Sub
"Justin" wrote:
I have a simple VB form with many controls. When user add/modify a
record....if the user click the form close button...system should show a
messagebox that "something is modified. Do you really want to close?"
Instead of writing code in each and every control on the form....is there
any betterway (may be at form-level) to identify that user has modified
"somewhere" in the form?
Thanks in advance
J Justin