Marc,
 
    Apparently, you are seeking to force the AfterUpdate event of parent form from within the AfterUpdate event of subform.
 
    One of the convenient ways to save the current record and force AfterUpdate event of a form (which has been dirtied), is to set its Dirty property to False.
 
    However, in a form / subform situation, whenever you enter a subform, AfterUpdate event of the parent form has already fired and it is no longer dirty. Similarly, when you leave the subform and enter the parent form, AfterUpdate event of the subform has already fired and it is no longer dirty.
 
    Therefore, a straightforward statement like the following (in subform's module), is not effective.
    Me.Parent.Dirty = False
 
    Solution therefore lies in calling the AfterUpdate event of the parent form through a public procedure embedded in the parent form itself. Sample procedure named P_FormAfterUpDt(), to be included in parent form's module, is given below. Having done this, sample code in subform's AfterUpdate event, as given below, will force AfterUpdate event of the parent form as well.
 
Best wishes,
A.D.Tejpal
 
Parent Form's Module
================================
Public Sub P_FormAfterUpDt()
    Form_AfterUpdate
End Sub
================================
 
SubForm's Module
================================
Private Sub Form_AfterUpdate()
    Me.Parent.P_FormAfterUpDt
End Sub
================================
 
----- Original Message -----
Sent: Wednesday, September 07, 2005 04:09
Subject: [AccessDevelopers] on update
 
I have some code that I have firing on the on update event in a form. I just realized that if the update only occurs in one of the forms subforms the code does not fire. I want it to, is there a better event to place the code into or is this not possible.
 
thanks,.
 
marc



Please zip all files prior to uploading to Files section.




SPONSORED LINKS
Microsoft access developer Microsoft access help Microsoft access database
Microsoft access training Microsoft access training course Microsoft access programming


YAHOO! GROUPS LINKS




Reply via email to