Saphirah
Active member
- Local time
- Today, 14:27
- Joined
- Apr 5, 2020
- Messages
- 163
Hello everyone,
i am working on a quite general system that should be used in any form.
I have a popup form that can be opened on a lot of forms. This Popup form is a list where you can select values from.
When opening the form, the "target control" is saved as a public variable. This is the control where the selected value should be saved to after selecting an element from the list.
Whenever the user selects something from the list, the value is written to that target control and the Form closes again.
This works fine. But i do need to trigger the _AfterUpdate Event of the "TargetControl" manually, as this is not triggered when changing the value by code.
I could theoretically hard code every Update event.
But because the Popup form is used on various other forms, and will be used on more in the future, i need a generic way to call this update event.
I know of the "Run" function, and i tried something like this:
Which will result in
But this outputs a "Module not found" error.
So, my dear coding friends
Can anyone help me with this problem?
How can i call the _AfterUpdate event of the "TargetControl" without hardcoding?
Thank you very much!
i am working on a quite general system that should be used in any form.
I have a popup form that can be opened on a lot of forms. This Popup form is a list where you can select values from.
When opening the form, the "target control" is saved as a public variable. This is the control where the selected value should be saved to after selecting an element from the list.
Code:
Public TargetControl As Control
Whenever the user selects something from the list, the value is written to that target control and the Form closes again.
Code:
TargetControl = Me.SelectedValue
DoCmd.CloseForm(Form.Name)
This works fine. But i do need to trigger the _AfterUpdate Event of the "TargetControl" manually, as this is not triggered when changing the value by code.
I could theoretically hard code every Update event.
But because the Popup form is used on various other forms, and will be used on more in the future, i need a generic way to call this update event.
I know of the "Run" function, and i tried something like this:
Code:
Run TargetControl.Parent.Name & "." & TargetControl.Name & "_AfterUpdate"
Code:
Run MyFormName.MyControlName_AfterUpdate
So, my dear coding friends

How can i call the _AfterUpdate event of the "TargetControl" without hardcoding?
Thank you very much!