Call Event Handler
Posted on 2014-07-16
MsAccess 2005. I have a form with many controls that the user has to fill in. As a time saver, i've implimented the ability whereby the Ctrl->G keystroke combination gets the corresponding value from another record which the user has identified as being compatible.
So I have one routine which uses screen.activecontrol.name to identify the field. It then gets the value and writes it in. The thing which is missing is that I then need to call the control's AfterUpdate event which makes other things happen. So this is a simplified version of the code I would like to get working.
Public Sub GetValueFromOtherRecord
Dim Fieldname as string
Dim EventHandlerName as string
EventHandlerName = FieldName & "_AfterUpdate
Call EventHandlerName 'This is the line which needs to be fixed
The Call statement doesn't work, presumably because the Event Name needs to be explicitly typed in my code. Is there a way I can dynamically call a procedure name?