How to recognize datachange in subform ..

  • Thread starter Thread starter Amin
  • Start date Start date
A

Amin

Hi,
Thanks in advance..
I have main form.. with tabcontrols
one of tabacontrol .. I have subform(link to main form)
i want to recognise.. datachange (update,delete,add) made in the subform if
made In the main form ..
How to code..?
amin.
 
Amin,

I am not at all clear if you want to check the main form
from the subform or the subform from the mainform. I am also
not clear on what would trigger the check, but the Dirty
property is probably what you want to use. It is True any
time a record is undergoing data modification. Don't think
that it would catch a delete, but that is an event that is
easy to trap and cancel if needed.

On whatever event you use...

' Main form checking subform...
If Me!SubFormControl.Form.Dirty = True Then
' Yes it is being modified in some way, do whatever
Else
' Nope, just being looked at
End If

' Subform checking main form...

If Me!Parent.Dirty = True Then
' Yes it is being modified in some way, do whatever
Else
' Nope, just being looked at
End If

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
 
Back
Top