I have a form (MyForm) with many identical bound textboxes that all need the same OnDblClick event. I don't want to have code for each control but rather call a function. The function is very simple - enter a numeric value into the bound field and change the control's back colour. The function therefore needs to know the control that called it.
I think I need to do something like the following, but do not know the correct method:
Set the OnDblClick event for each control to, say "=funcDblClick()"
then have a function in a module something like:
Function funcDblClick()
[Forms]![MyForm]![Control that called function] = Value
[Forms]![MyForm]![Control that called function].BackColor = 255
End Function
How do I pass the control reference to the function?
I think I need to do something like the following, but do not know the correct method:
Set the OnDblClick event for each control to, say "=funcDblClick()"
then have a function in a module something like:
Function funcDblClick()
[Forms]![MyForm]![Control that called function] = Value
[Forms]![MyForm]![Control that called function].BackColor = 255
End Function
How do I pass the control reference to the function?