From: Arvin Meyer [MVP] on
The forms index starts with the first form opened and ends with the last. I
gave you the code snippet to check that for yourself. Many developers want
to control what happens during close down so the open a form hidden when
Access opens, then if they ever need to close everything, the code they use
is uses something like:

For i = Forms.Count - 1 To 0 Step -1
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access
Co-author: "Access 2010 Solutions", published by Wiley


"Lord Kelvan" <the_iddiot(a)hotmail.com> wrote in message
news:80814c89-3df9-43eb-ae07-6e3a000b9e6a(a)34g2000prs.googlegroups.com...
Yes I know how to check which order the forms are in again that�s not
my question

I just want to know if the collection is stable as if I opened a form
and I have 3 other forms open will it make the index of that form 3
(i.e. 0,1,2,3) or is there a chance that it will for some unknown
reason make the index of that form 1.

Are there any circumstances this might happen or anything I have to
lookout for when I programme as to no destroy my application because
the last form opened for some reason because of an issue with the
collection that I don�t know about is not the last form in the
collections index.

Regards
Kelvan


From: Jon Lewis on
I think you're slightly misunderstanding the question Arvin.

If a number of forms are opened, do they retain the same Index *order*
throughout the life of the collection? Specifically is the Item with the
highest Index in the Collection always the last Form opened? I think this
is the case Kelvan but the Index itself can change with a collection. For
example, if you remove Item(0) then all the items are shifted down one so
that what was Item 1 becomes Item 0 and so on but as far as I know the order
is not changed. This is not the case with an array which always retains
it's original Indexing and this might be a more appropriate Object for you
to work with.

HTH

Jon


"Arvin Meyer [MVP]" <arvinm(a)mvps.invalid> wrote in message
news:eOM77rN%23KHA.3628(a)TK2MSFTNGP04.phx.gbl...
> The forms index starts with the first form opened and ends with the last.
> I gave you the code snippet to check that for yourself. Many developers
> want to control what happens during close down so the open a form hidden
> when Access opens, then if they ever need to close everything, the code
> they use is uses something like:
>
> For i = Forms.Count - 1 To 0 Step -1
> --
> Arvin Meyer, MCP, MVP
> http://www.datastrat.com
> http://www.accessmvp.com
> http://www.mvps.org/access
> Co-author: "Access 2010 Solutions", published by Wiley
>
>
> "Lord Kelvan" <the_iddiot(a)hotmail.com> wrote in message
> news:80814c89-3df9-43eb-ae07-6e3a000b9e6a(a)34g2000prs.googlegroups.com...
> Yes I know how to check which order the forms are in again that's not
> my question
>
> I just want to know if the collection is stable as if I opened a form
> and I have 3 other forms open will it make the index of that form 3
> (i.e. 0,1,2,3) or is there a chance that it will for some unknown
> reason make the index of that form 1.
>
> Are there any circumstances this might happen or anything I have to
> lookout for when I programme as to no destroy my application because
> the last form opened for some reason because of an issue with the
> collection that I don't know about is not the last form in the
> collections index.
>
> Regards
> Kelvan
>


From: Arvin Meyer [MVP] on

"Jon Lewis" <jon.lewis(a)cutthespambtinternet.com> wrote in message
news:%23C5mA4P%23KHA.4652(a)TK2MSFTNGP06.phx.gbl...
>I think you're slightly misunderstanding the question Arvin.
>
> If a number of forms are opened, do they retain the same Index *order*
> throughout the life of the collection?

Yes, as long as the collection is unchanged.

> Specifically is the Item with the highest Index in the Collection always
> the last Form opened?

Yes

> I think this is the case Kelvan but the Index itself can change with a
> collection. For example, if you remove Item(0) then all the items are
> shifted down one so that what was Item 1 becomes Item 0 and so on but as
> far as I know the order is not changed.

The order only changes as forms are deleted from and added to the
collection.

> This is not the case with an array which always retains it's original
> Indexing and this might be a more appropriate Object for you to work with.

An array does not change because it doesn't gain or lose elements unless it
is redim'd. It them changes unless Redim Preserve is used.

--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access
Co-author: "Access 2010 Solutions", published by Wiley




> "Arvin Meyer [MVP]" <arvinm(a)mvps.invalid> wrote in message
> news:eOM77rN%23KHA.3628(a)TK2MSFTNGP04.phx.gbl...
>> The forms index starts with the first form opened and ends with the last.
>> I gave you the code snippet to check that for yourself. Many developers
>> want to control what happens during close down so the open a form hidden
>> when Access opens, then if they ever need to close everything, the code
>> they use is uses something like:
>>
>> For i = Forms.Count - 1 To 0 Step -1
>> --
>> Arvin Meyer, MCP, MVP
>> http://www.datastrat.com
>> http://www.accessmvp.com
>> http://www.mvps.org/access
>> Co-author: "Access 2010 Solutions", published by Wiley
>>
>>
>> "Lord Kelvan" <the_iddiot(a)hotmail.com> wrote in message
>> news:80814c89-3df9-43eb-ae07-6e3a000b9e6a(a)34g2000prs.googlegroups.com...
>> Yes I know how to check which order the forms are in again that's not
>> my question
>>
>> I just want to know if the collection is stable as if I opened a form
>> and I have 3 other forms open will it make the index of that form 3
>> (i.e. 0,1,2,3) or is there a chance that it will for some unknown
>> reason make the index of that form 1.
>>
>> Are there any circumstances this might happen or anything I have to
>> lookout for when I programme as to no destroy my application because
>> the last form opened for some reason because of an issue with the
>> collection that I don't know about is not the last form in the
>> collections index.
>>
>> Regards
>> Kelvan
>>
>
>


From: Lord Kelvan on
thanks jon

many sleepless nights to get that

Regards
Kelvan
From: "Jon Lewis" jon.lewis on

"Arvin Meyer [MVP]" <arvinm(a)mvps.invalid> wrote in message
news:eLxfo3V%23KHA.5464(a)TK2MSFTNGP05.phx.gbl...
>
> "Jon Lewis" <jon.lewis(a)cutthespambtinternet.com> wrote in message
> news:%23C5mA4P%23KHA.4652(a)TK2MSFTNGP06.phx.gbl...
>>I think you're slightly misunderstanding the question Arvin.
>>
>> If a number of forms are opened, do they retain the same Index *order*
>> throughout the life of the collection?
>
> Yes, as long as the collection is unchanged.
>
>> Specifically is the Item with the highest Index in the Collection always
>> the last Form opened?
>
> Yes
>
>> I think this is the case Kelvan but the Index itself can change with a
>> collection. For example, if you remove Item(0) then all the items are
>> shifted down one so that what was Item 1 becomes Item 0 and so on but as
>> far as I know the order is not changed.
>
> The order only changes as forms are deleted from and added to the
> collection.

Does the order change? This is the salient point Arvin.
You open up FormA, FormB, FormC, FormD in that order.
They then correspond to Forms.Item(0), Forms.Item(1), Forms.Item(2),
Forms.Item(3) in the Forms collection
Remove Forms.Item(3) from the collection
We're left with Forms.Item(0), Forms.Item(1), Forms.Item(2)
Is it certain that Forms.Item(0), Forms.Item(1), Forms.Item(2) correspond to
FormA, FormB, FormC in that order?
or
Remove Forms.Item(0) from the collection.
The element's are 'shifted' down.
We're left with Forms.Item(0), Forms.Item(1), Forms.Item(2)
Is it certain that Forms.Item(0), Forms.Item(1), Forms.Item(2) correspond to
FormB, FormC, FormD in that order?

I would say yes but is this preservation of the order of the remaining items
when an item is deleted (from anywhere in the collection) documented
>
>> This is not the case with an array which always retains it's original
>> Indexing and this might be a more appropriate Object for you to work
>> with.
>
> An array does not change because it doesn't gain or lose elements unless
> it is redim'd. It them changes unless Redim Preserve is used.

Yes but what I meant is that you have manual control of array indexing in
that you can remove an element by manually shifting the remaining elements
making sure that the indexing follows your rules.

Jon

>
> --
> Arvin Meyer, MCP, MVP
> http://www.datastrat.com
> http://www.accessmvp.com
> http://www.mvps.org/access
> Co-author: "Access 2010 Solutions", published by Wiley
>
>
>
>
>> "Arvin Meyer [MVP]" <arvinm(a)mvps.invalid> wrote in message
>> news:eOM77rN%23KHA.3628(a)TK2MSFTNGP04.phx.gbl...
>>> The forms index starts with the first form opened and ends with the
>>> last. I gave you the code snippet to check that for yourself. Many
>>> developers want to control what happens during close down so the open a
>>> form hidden when Access opens, then if they ever need to close
>>> everything, the code they use is uses something like:
>>>
>>> For i = Forms.Count - 1 To 0 Step -1
>>> --
>>> Arvin Meyer, MCP, MVP
>>> http://www.datastrat.com
>>> http://www.accessmvp.com
>>> http://www.mvps.org/access
>>> Co-author: "Access 2010 Solutions", published by Wiley
>>>
>>>
>>> "Lord Kelvan" <the_iddiot(a)hotmail.com> wrote in message
>>> news:80814c89-3df9-43eb-ae07-6e3a000b9e6a(a)34g2000prs.googlegroups.com...
>>> Yes I know how to check which order the forms are in again that's not
>>> my question
>>>
>>> I just want to know if the collection is stable as if I opened a form
>>> and I have 3 other forms open will it make the index of that form 3
>>> (i.e. 0,1,2,3) or is there a chance that it will for some unknown
>>> reason make the index of that form 1.
>>>
>>> Are there any circumstances this might happen or anything I have to
>>> lookout for when I programme as to no destroy my application because
>>> the last form opened for some reason because of an issue with the
>>> collection that I don't know about is not the last form in the
>>> collections index.
>>>
>>> Regards
>>> Kelvan
>>>
>>
>>
>
>

First  |  Prev  |  Next  |  Last
Pages: 1 2 3
Prev: Don't add record
Next: Text Box