Running an AfterUpdate event from another Sub

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Is there a way to trigger a control's AfterUpdate event from another Sub?

Thanks in advance,

Paul
 
Is there a way to trigger a control's AfterUpdate event from another Sub?

Thanks in advance,

Paul

From another Sub?
On the same form?
NameOfControl_AfterUpdate

From a different Form?
Make sure the AfterUpdate sub procedure is set to Public.
The form must be open.

To call it from another Form or Module:
Call Forms("NameOfForm").ControlName_AfterUpdate

To call a sub procedure on a sub form, use:

Call Forms("FormName").SubformControlName.Form.ControlName_AfterUpdate

Substitute the actual name of your main form where it says "FormName".
Substitute the actual name of the subform control on the main form
which holds the sub form (not the name of the form used as the
subform) where it says "SubformControlName".
 
Works great.

Thanks for the solution, Fred.


fredg said:
From another Sub?
On the same form?
NameOfControl_AfterUpdate

From a different Form?
Make sure the AfterUpdate sub procedure is set to Public.
The form must be open.

To call it from another Form or Module:
Call Forms("NameOfForm").ControlName_AfterUpdate

To call a sub procedure on a sub form, use:

Call Forms("FormName").SubformControlName.Form.ControlName_AfterUpdate

Substitute the actual name of your main form where it says "FormName".
Substitute the actual name of the subform control on the main form
which holds the sub form (not the name of the form used as the
subform) where it says "SubformControlName".
 
Back
Top