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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AfterUpdate event for dynamic created TextBoxes

Status
Not open for further replies.

moyoxx

Programmer
Jul 20, 2007
1
SK
Hello,

I am working on UserForm where textboxes are dynamically created according to ammount of columns in a table placed in worksheet. Everything goes well except use of AfterUpdate event. To treat events of dynamic textboxes I use folloving code:

In the UserForm:

Dim gTextBoxes() As TextBoxesClass

Public Sub UserForm_Initialize()
...
For i = 1 To lngTableLength
Set txtActualTextBox =
ReDim Preserve gtbcTextBoxes(lngTableCol)
Set gTextBoxes(lngActualItemCol) = New TextBoxesClass
Set gTextBoxes(lngActualItemCol).txtTextBox = _
MyForm.Frame1.Controls.Add("Forms.TextBox.1", "txt" & i , True)
Next i
...
End Sub

In Class Module TextBoxesClass:

Public WithEvents txtTextBox As MSForms.TextBox

Private Sub txtTextBox_Change()
'some code
End Sub

The Problem: is that TextBoxesClass does not know AfterUpdate event, which miss me very much because I would like to launch some actions really only in the moment when the textbox is updated, and no on each change of its content.

Do you know how to make it to be able to use AfterUpdate even for dynamicaly created texboxex? Is there some substitute posibility?

Thanks, bye :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top