assign objects into array or object variable?

  • Thread starter Thread starter Fendic
  • Start date Start date
F

Fendic

Hi

Does anyone know how to assign objects, e.g. Label, TextBox and etc
into an array?

I can't even assign a label into an object variable. Can anyone hel
please? Thank you.

All the best,
Fendi
 
This works for me

Dim ary
Dim ctl
ReDim ary(1 To 1)
For Each ctl In Me.Controls
If TypeName(ctl) = "TextBox" Then
If UBound(ary) <> 1 Then
ReDim Preserve ary(1 To UBound(ary) + 1)
ary(UBound(ary)) = ctl
End If
End If
Next ctl


--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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