After Update Event not Firing

JasonOliver

New member
Local time
Today, 13:57
Joined
Apr 23, 2008
Messages
3
Hi,

I have a Master form that runs code in it's After Update event to amend an outlook task. The Master form contains a textbox (txtRecordUpdate) that is set to "Y" when certain fields are changed and then the After Update code checks to see whether it is set to "Y" before running the outlook update code. This all works fine execpt for when I only update 1 particular field that is held within a subform of the Master form.

When I amend the subform field the After Update of the subform sets txtRecordUpdate in the Master form to "Y" but then the After Update on the Master form does not fire as I haven't made any changes to the Master form controls.

Does anyone know a way to froce the After Update to fire or whether I can use an alternative events for when the user moves to a new record?

Cheers for any help

Jason
 
Is the txtRecordUpdate control bound? If so then you could modify it from the SubForm and that should set the MainForm to Dirty.
 
Last edited:
Thanks for the reply RuralGuy. In answer to your question the control is not bound but I set up 2 new bound controls to try this out previously and got an error. The control I'm testing now is called dtmRecordAmended and I created the following code in the After Update event of the subform:

Private Sub Form_AfterUpdate()
Forms!frmCall_Logging.txtRecordUpdate = "Y"
Forms!frmCall_Logging.dtmRecordAmended = Now()
End Sub

This returns the runtime error "The data has been changed"

Is this to do with the way I reference the master form controls?
 
Try using the BeforeUpdate event of the SubForm instead.
 
You're welcome. Thanks for posting back with your success.
 

Users who are viewing this thread

Back
Top Bottom