Question Checking values have changed...

cadwalli

Active member
Joined
May 27, 2010
Messages
41
Location
United Kingdom
Programming Experience
10+
Hi, Ive taken a look at other posts to make sure im not repeating a question but can see nothing similar but please forgive me (and point me to the relevant post) if there is another post.

I'm basically putting some validation logic around an undo button on my form and i'd like to check whether any fields on the form have had their values changed so i can ask the question "abandon changes?".

This seems like something pretty standard to me but I can not see how to check whether a value has had its contents changed (without recording a before value and comparing it to the after value which for large forms would be quite horrendous to code).

In the language i used to use we used to walk the object tree (so we dont have to specify each object individually like text box, combo box etc) and check any object that have value-changed = yes to indicate the validation was required.

Is there anything simple like this in VB.

Thanks for your help.

Ian
 
ok so ive managed to crack the first part (identifying all the controls on my form) with :

Dim c As Control
For Each c In GroupBox1.Controls
If TypeOf c Is TextBox Then
MsgBox(c.Name)
End If
Next

which brings back all the text boxes and buttons etc, so im just left with the puzzle of value-changed....? any ideas

TIA

Ian
 
Back
Top