I have a form with eight textbox controls on it. I have the following procedure which should delete each of the textboxes. What it really does is delete every other textbox on the form. I click a button to call the "Clear_Tbox" procedure and what I'm left with are Textbox2, textbox4, textbox6, and textbox8. Anyone have an idea why this might be?
Private Sub Clear_Tbox()
Dim ctl As Control
For Each ctl In Me.Controls
If TypeOf ctl Is TextBox Then
ctl.Dispose()
End If
Next
End Sub
Private Sub Clear_Tbox()
Dim ctl As Control
For Each ctl In Me.Controls
If TypeOf ctl Is TextBox Then
ctl.Dispose()
End If
Next
End Sub