MULTITUDE CONTROLS

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

HI Guys
I have a form with scores of similar texboxes. I want to avoid a
multiplicity of coding. How do I code their Double-Click or Before-Update or
After-Update events just once instead of having to do it in each control?
 
Create a function (not a sub).

Select all of the textboxes (you can lasso them, or you can click on them
while holding down the shift key, or you can place your mouse pointer at the
top or right of the form to select everything in a line, or a combination of
those methods). Select the Property box, and put =MyFunction() for the
DoubleClick or BeforeUpdate event. (include the equal sign and parentheses)

Inside your function, you can refer to Me.ActiveControl if you need to know
the specific textbox with which you're dealing.
 
Thanx.
--
Glint


Douglas J. Steele said:
Create a function (not a sub).

Select all of the textboxes (you can lasso them, or you can click on them
while holding down the shift key, or you can place your mouse pointer at the
top or right of the form to select everything in a line, or a combination of
those methods). Select the Property box, and put =MyFunction() for the
DoubleClick or BeforeUpdate event. (include the equal sign and parentheses)

Inside your function, you can refer to Me.ActiveControl if you need to know
the specific textbox with which you're dealing.
 
Back
Top