On save_click event I want to check what fields have changed. I know I can check it the form has been changed by going IF ME.DIRTY....but what about every specific field?
Dirty can only apply to a form. You would have to put code in every control to check for input and keep a note in variables of which fields have been changed. Have fun! )
As long as the record has not been saved then for each control you can compare the value to the oldvalue:
Dim cntl As Control
For Each cntl In Me.Controls
If cntl.ControlType = acTextBox Or etc(control types to check Then
If cntl.Value <> cntl.OldValue Then
Do your stuff here
End If
End If
Next cntl
aA bit easier to check if the control has a control source and that it (control source) is not blank that to enumerate the type of controls. Just incl on err resume next in the loop ... this just picke out the BOUND controls, which is what you really want. Of course is you are using the unbound control approach, you already have the list of controls which you map to the db, so the above isn't applicable at all.
MichaelRed
m.red@att.net
There is never time to do it right but there is always time to do it over
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.