For...Next Loop Problem

Shaft

Registered User.
Local time
Today, 20:43
Joined
May 25, 2005
Messages
51
In the following code how would I make the A1 control reference increase when the i increases i.e when i=2 reference A2, i=3 reference A3.

Code:
For i = 1 To 33
    Forms![Engineer Full Report].[A[COLOR=Red]1[/COLOR]].ForeColor = RGB(255, 128, 0)
    Forms![Engineer Full Report].[A[COLOR=Red]1[/COLOR]].FontBold = True
Next

Any help would be much appreciated

Thank you
 
try this

Code:
For i = 1 To 33
    Forms![Engineer Full Report].[Controls("A" & i)].ForeColor = RGB(255, 128, 0)
    Forms![Engineer Full Report].[Controls("A" & i)].FontBold = True
Next i

hope it helps :)
 
That worked like a treat, just needed to drop the [] around the controls reference in the code you posted.

Thank you very much
 

Users who are viewing this thread

Back
Top Bottom