GK in the UK
Registered User.
- Local time
- Today, 20:46
- Joined
- Dec 20, 2017
- Messages
- 274
OK struggling to get this one fixed.
A tab control with 6 pages. Ordinally numbered from 0 of course.
The OnChange event has a big ugly CASE select with some code that could be massively streamlined, but I need to get a value from each tab then drop it in a few places.
So I put some text in each of the tab tag property.
The tab pages have the Page Index property set as I expect, from 0 to 5, and each tab page has some text, two tabs that I'm currently coding have part of a sub form name.
After some experimentation I get the following consistent result:
Me.TabCtlIndexes.value - returns 0 to 5 as I expect
and
Me(Me.TabCtlIndexes.value).Tag - returns the tab tag text as I expect
So to get the tab tag text without the CASE statement seems to be with this construct:
Me(Me.TabCtlIndexes.value).Tag - which works, sort of
I know there is a difference of 1 somewhere, mentioned in the MS documentation but that doesn't explain the weird results I'm getting
THE CORRECT ORDER of the tab tag text is as follows, from the 1st tab (0), then add 1 for the difference somewhere in there
(1) Templates
(2) Quotations
(3) Orders
(4) IndexDaybook
(5) Index Posted
(6) OrdersComp
After not getting the right results I popped in a MsgBox and I find that I'm getting:
Tag(0)
Tag(1) - Templates
Tag(2) - Quotations
Tag(3) - Orders
Tag(4) - IndexDaybook
Tag(5) -
Tag(6) - IndexPosted
With an empty Tag(5).
Thinking it must be corruption of some kind, I deleted the tab control with its sub forms, de-compiled and rebuilt it.
The tab control has been rebuilt in the same order, all numbered as you would expect.
Now I get
Tag(0)
Tag(1)
Tag(2)
Tag(3) - Templates
Tag(4) - Quotations
Tag(5) - Orders
Tag(6) - ThIndexDaybook
What is going on ?
A tab control with 6 pages. Ordinally numbered from 0 of course.
The OnChange event has a big ugly CASE select with some code that could be massively streamlined, but I need to get a value from each tab then drop it in a few places.
So I put some text in each of the tab tag property.
The tab pages have the Page Index property set as I expect, from 0 to 5, and each tab page has some text, two tabs that I'm currently coding have part of a sub form name.
After some experimentation I get the following consistent result:
Me.TabCtlIndexes.value - returns 0 to 5 as I expect
and
Me(Me.TabCtlIndexes.value).Tag - returns the tab tag text as I expect
So to get the tab tag text without the CASE statement seems to be with this construct:
Me(Me.TabCtlIndexes.value).Tag - which works, sort of
I know there is a difference of 1 somewhere, mentioned in the MS documentation but that doesn't explain the weird results I'm getting
THE CORRECT ORDER of the tab tag text is as follows, from the 1st tab (0), then add 1 for the difference somewhere in there
(1) Templates
(2) Quotations
(3) Orders
(4) IndexDaybook
(5) Index Posted
(6) OrdersComp
After not getting the right results I popped in a MsgBox and I find that I'm getting:
Tag(0)
Tag(1) - Templates
Tag(2) - Quotations
Tag(3) - Orders
Tag(4) - IndexDaybook
Tag(5) -
Tag(6) - IndexPosted
With an empty Tag(5).
Thinking it must be corruption of some kind, I deleted the tab control with its sub forms, de-compiled and rebuilt it.
The tab control has been rebuilt in the same order, all numbered as you would expect.
Now I get
Tag(0)
Tag(1)
Tag(2)
Tag(3) - Templates
Tag(4) - Quotations
Tag(5) - Orders
Tag(6) - ThIndexDaybook
What is going on ?