I'm trying to call the AfterUpdate event for a few controls in a form from a procedure in a module. I've successfully managed to reference a Control and some properties like so:
Form_frmFindCourses.Controls("EHCost Check"
.Value =
Form_frmFindCourses.Controls("EHCost Check"
.Enabled =
etc etc.
The "EHCost Check" will be replaced with controlName, a string variable which is passed to the procedure in the module. Hence why I can't use:
Call Form_frmFindCourses.EHCost_Check_AfterUpdate
So what I thought I could use is:
Call Form_frmFindCourses.Controls(controlName).AfterUpdate
I believed this should work since
Form_frmFindCourses.Controls(controlName).Enabled = False
works fine.
But I get the dreaded Object doesn't support this property or method error message. I can't understand why since all controlName variables passed are the names of controls that definitely have AfterUpdate as a method/property.
Can anyone advise?
Cheers,
Pete
Form_frmFindCourses.Controls("EHCost Check"
Form_frmFindCourses.Controls("EHCost Check"
etc etc.
The "EHCost Check" will be replaced with controlName, a string variable which is passed to the procedure in the module. Hence why I can't use:
Call Form_frmFindCourses.EHCost_Check_AfterUpdate
So what I thought I could use is:
Call Form_frmFindCourses.Controls(controlName).AfterUpdate
I believed this should work since
Form_frmFindCourses.Controls(controlName).Enabled = False
works fine.
But I get the dreaded Object doesn't support this property or method error message. I can't understand why since all controlName variables passed are the names of controls that definitely have AfterUpdate as a method/property.
Can anyone advise?
Cheers,
Pete