Label counting

  • Thread starter Thread starter Aziz
  • Start date Start date
A

Aziz

Does anyone have any code that enables me to count the
number of labels on a form. I ultimately want to check
whether one of the labels caption property has the string
that I expect.
 
-----Original Message-----
Does anyone have any code that enables me to count the
number of labels on a form. I ultimately want to check
whether one of the labels caption property has the string
that I expect.
.

Try this,
-----------
Dim ctrl As Control
Dim iIndex As Integer

For Each ctrl In Me.Controls
If ctrl.ControlType = acLabel Then
iIndex = iIndex + 1
End If
Next ctrl
 
Back
Top