I am trying to refer to a label control using an Array I have populated with the names of my labels. When I open my form I get a Run-time error '438' Object doesn't support this property or method. What method should I use to loop through the labels using a variable name? Thank you in advance for your help!
Dim MonthArr
MonthArr = Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")
Dim MonthCounter As Integer
MonthCounter = Month(Now())
Dim YearCounter As Integer
YearCounter = Year(Now())
Dim LblArr
LblArr = Array(LastMonthsMaxlbl, CurrentMonthlbl, CurrMonthPlus1)
Dim LblCounter As Integer
For LblCounter = 0 To 2
Forms(subfrmForecast).Controls(LblArr(LblCounter)) .Caption = MonthArr(MonthCounter - 2) & " " & CStr(YearCounter) & " BPS"
MonthCounter = MonthCounter + 1
If MonthCounter = 12 Then
YearCounter = YearCounter + 1
MonthCounter = 0
End If
Next