control array

  • Thread starter Thread starter sps
  • Start date Start date
S

sps

I have several similar controls on my form that need to do
basically the same thing. I would like to be able to
create an array of the controls so I can access them all
with a loop rather than multiple procedures. How do I get
this to work in Access 2000?
 
sps said:
I have several similar controls on my form that need to do
basically the same thing. I would like to be able to
create an array of the controls so I can access them all
with a loop rather than multiple procedures. How do I get
this to work in Access 2000?


Access doesn't have control arrays. The usual technique is
to name the controls something like txtCd1, txtCd2, ... so
you can use this kind of code:

For k = 1 To 12
Me("txtCd" & k).Enabled = False
Next k
 
Brackets. I was missing the brackets, thanks.
-----Original Message-----



Access doesn't have control arrays. The usual technique is
to name the controls something like txtCd1, txtCd2, ... so
you can use this kind of code:

For k = 1 To 12
Me("txtCd" & k).Enabled = False
Next k
 
Back
Top