Running an AfterUpdate event from another Sub

P

Paul

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

Thanks in advance,

Paul
 
F

fredg

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".
 
P

Paul

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".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top