form.control(index)

  • Thread starter Thread starter Dsperry101 via AccessMonster.com
  • Start date Start date
D

Dsperry101 via AccessMonster.com

Hello all,

Is it possible to change the index of a control on a form. I guess
access numbers them incrementally as they are created. For instance group all
the text boxes in a sequential block .


Dan S
 
Hello all,

Is it possible to change the index of a control on a form. I guess
access numbers them incrementally as they are created. For instance group all
the text boxes in a sequential block .

Dan S

There is no index other than the name. You can choose the name and
use code to position them. For example, you could have 20 labels
named lblGridR1C1 to lblGridR4C5, and then position them with a couple
of FOR loops. Each label can be addressed like the following
example: Me("lblGridR2C3").top=Me("lblGridR1C3").top +
Me("lblGridR1C3").Height
Is this what you were looking for?
 
There is no index other than the name.

Of course there is! Every collection is addressable by index number
and by key. In the case of controls, the name is the key value, but
the index number is available, as well.

If you want to change the index number of already-created controls,
you need to change the z-order, by doing send-to-front/send-to-back
in the order that you want the controls to be in the index.
 
Back
Top