With statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

SInce I cannot create an array of controls in MS Access 2000, I have created several controls with the name

lblE1, lblE2, lblE3,.....lblE5

on a form

I need to pass each control through a subroutine as follow

SubName Me.lblE
SubName Me.lblE


SubName Me.lblE5

Needless to say, this is rather cumbersom
What I would rather do i

for i = 1 to 5
SubName "Me.lblE" & cstr(i
next

where the subroutine is defined a
Public Sub SubName(ctl As Control

Am I stuck with the original coding or is there a better way to do this

Thank
 
Hi,
You can do it the way you want, like this:
for i = 1 to 50
SubName Me("lblE" & i)
next i

HTH
Dan Artuso, MVP

Sheldon said:
SInce I cannot create an array of controls in MS Access 2000, I have
created several controls with the names
 
Back
Top