D
dchman
I have an app for which one requirement is to add controls to a form
dynamically. For some of the controls, I set the OnMouseDown event to an
expression;
strExpr = "[Forms]![frmDisplay]![" & ctl.Name & "]"
ctl.OnMouseDown = "= SetCurCtrl(" & strExpr & ")"
Essentially the expression calls the function "SetCurCtrl" with a reference
to itself.
At run time, after the form is built, it is presented to the user. If the
user clicks one of the controls, the MouseDown event fires the expression.
I also want to dynamically code the OnKeyDown event to call a function which
takes the control reference and the KeyCode for the key which triggers the
event. However, when writing the code to dynamically create the expression,
I don't know how to refer to the KeyCode for the triggering key. Can anyone
point me in the right direction?
thanks
dynamically. For some of the controls, I set the OnMouseDown event to an
expression;
strExpr = "[Forms]![frmDisplay]![" & ctl.Name & "]"
ctl.OnMouseDown = "= SetCurCtrl(" & strExpr & ")"
Essentially the expression calls the function "SetCurCtrl" with a reference
to itself.
At run time, after the form is built, it is presented to the user. If the
user clicks one of the controls, the MouseDown event fires the expression.
I also want to dynamically code the OnKeyDown event to call a function which
takes the control reference and the KeyCode for the key which triggers the
event. However, when writing the code to dynamically create the expression,
I don't know how to refer to the KeyCode for the triggering key. Can anyone
point me in the right direction?
thanks