Hello,
I have a form (frmProductsEdit1) and a subform (frmSubPackaging) attached to the form. If any field on the subform changes, I want code to run once the focus is back on the main form that updates the revision date for the specific product code (done by an update query).
The code I am using can be found below, which is being called from the main form:
It appears that this code NEVER runs, because from the looks of things the instant the focus leaves the subform, the record saves, with no chance for the Subform to register as "dirty".
What am I doing wrong? Is there some better way to do this? I want to be able to make a change to the subform and then have the code attached run only if there are any changes that previously occurred on the subform.
Look forward to your response.
Thanks so much!
Best Regards,
Chris
I have a form (frmProductsEdit1) and a subform (frmSubPackaging) attached to the form. If any field on the subform changes, I want code to run once the focus is back on the main form that updates the revision date for the specific product code (done by an update query).
The code I am using can be found below, which is being called from the main form:
Code:
Private Sub frmSubPackaging_Exit(Cancel As Integer)
If Me.frmSubPackaging.Form.Dirty Then
Call SetPackSpecs(Me.PackSpec)
DoCmd.OpenQuery "qryUpdateRevisionDate2"
Forms!frmProductsEdit1!HB_TotalTare = Forms!frmProductsEdit1!frmSubPackaging!HBTotalTare
Me.Dirty = False
End If
End Sub
It appears that this code NEVER runs, because from the looks of things the instant the focus leaves the subform, the record saves, with no chance for the Subform to register as "dirty".
What am I doing wrong? Is there some better way to do this? I want to be able to make a change to the subform and then have the code attached run only if there are any changes that previously occurred on the subform.
Look forward to your response.
Thanks so much!
Best Regards,
Chris