Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assigning an event procedure to a control

Status
Not open for further replies.

lmontes

Programmer
Jan 28, 2002
25
US
Hello

I'm creating a new form using vba and need to assign an event procedure to each of the controls.

Is it possible to assign an event procedure to a textbox using vba?
 
Hi
These are the textbox events (from visual basic help).
BeforeUpdate (forms)
AfterUpdate (forms)
OnChange (forms)
OnClick (forms)
OnDblClick (forms)
OnEnter (forms)
OnExit (forms)
OnGotFocus (forms)
OnKeyDown (forms)
OnKeyPress (forms)
OnKeyUp (forms)
OnLostFocus (forms)
OnMouseDown (forms)
OnMouseMove (forms)
OnMouseUp (forms)
Is this what you meant?
 
what do you mean "assign an event procedure to each of the controls"? What are you trying to do?

You can't create custom controls with custom events like you can in VB, but you can subclass controls using WithEvents. More info is required.

Ben

----------------------------------------------
Ben O'Hara "Where are all the stupid people from...
...And how'd they get so dumb?"
rockband.gif
NoFX-The Decline
----------------------------------------------
Want to get great answers to your Tek-Tips questions? Have a look at F
 
I am creating a subform. Users will be enter number of hours in each textbox. I want to use the AfterUpdate event to total the hours for each week. (Each textbox represents a week).

I will be creating this subform each time they import a data table, so I need to do it dynamically.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top