By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,501 Members | 2,797 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,501 IT Pros & Developers. It's quick & easy.

Is a collection item's index number fixed.?

P: n/a
Hi all.
Could someone tell me is this number fixed when the item is created, or can
it be changed?

So for example if there are three forms, with index 0,1,2
and form 1 is deleted, does form with index 2, now get index 1?

Is the answer different depending on what the object is, eg Form or control.

Thanks in advance.

Gerry


Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
If you delete an item from a collection, the index of all the later items
reduces.

Using the Forms collection as an example, if you have 4 forms open, they
will be Forms(0) to Forms(3). If you close Forms(2), then Forms(3) becomes
Forms(2).

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html

"Gerry Abbott" <pl****@ask.ie> wrote in message
news:w3*******************@news.indigo.ie...
Hi all.
Could someone tell me is this number fixed when the item is created, or can it be changed?

So for example if there are three forms, with index 0,1,2
and form 1 is deleted, does form with index 2, now get index 1?

Is the answer different depending on what the object is, eg Form or

control.
Nov 12 '05 #2

P: n/a
Thanks Allen,

So if the form is not open, then it's not part of the collection?

Gerry
"Allen Browne" <ab***************@bigpond.net.au> wrote in message
news:Rs*******************@news-server.bigpond.net.au...
If you delete an item from a collection, the index of all the later items
reduces.

Using the Forms collection as an example, if you have 4 forms open, they
will be Forms(0) to Forms(3). If you close Forms(2), then Forms(3) becomes
Forms(2).

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html

"Gerry Abbott" <pl****@ask.ie> wrote in message
news:w3*******************@news.indigo.ie...
Hi all.
Could someone tell me is this number fixed when the item is created, or

can
it be changed?

So for example if there are three forms, with index 0,1,2
and form 1 is deleted, does form with index 2, now get index 1?

Is the answer different depending on what the object is, eg Form or

control.

Nov 12 '05 #3

P: n/a
That is correct.

In Access 2002, you can get the names of the forms from this collection:
CurrentProject.AllForms
Again, the index numbers change if forms are deleted.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html

"Gerry Abbott" <pl****@ask.ie> wrote in message
news:pw*******************@news.indigo.ie...
Thanks Allen,

So if the form is not open, then it's not part of the collection?

Gerry
"Allen Browne" <ab***************@bigpond.net.au> wrote in message
news:Rs*******************@news-server.bigpond.net.au...
If you delete an item from a collection, the index of all the later items reduces.

Using the Forms collection as an example, if you have 4 forms open, they
will be Forms(0) to Forms(3). If you close Forms(2), then Forms(3) becomes Forms(2).

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html

"Gerry Abbott" <pl****@ask.ie> wrote in message
news:w3*******************@news.indigo.ie...
Hi all.
Could someone tell me is this number fixed when the item is created,
or can
it be changed?

So for example if there are three forms, with index 0,1,2
and form 1 is deleted, does form with index 2, now get index 1?

Is the answer different depending on what the object is, eg Form or

control.


Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.