How to access all the textboxes inside a frame?

  • Thread starter Thread starter Yajiv
  • Start date Start date
Y

Yajiv

I have some 10 text boxes inside a frame. how can i iterate through
them?
 
something like following may do what you want:

Dim i As Integer
For i = 1 To 10
Controls("TextBox" & i).Text = i
Next
 
This code will find each of them for you...

Dim C As Control
For Each C In Me.Controls
If C.Parent.Name = "Frame1" Then
If TypeName(C) = "TextBox" Then
'
' You found a TextBox inside Frame1
' Put your code for it here.
'
End If
End If
Next

Rick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top