Tab control Caption

S

SleeplessTexas

Does anyone know how to display a data point from the supporting table (e.g.,
date value) on the TAB's caption property as opposed to manually writing it?
I once saw this applied in Access 97, I currently Access 2003...
 
G

Graham R Seach

Me!TabCtl1.Pages(0).Caption = "abc"

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
S

SleeplessTexas

Thanks Graham,
That helped as a start, but I probably should have explained a little bit
further.. I want to first, group those different values, and secondly taking
each value and adding a new Tab page writing that value to the page's caption
property...does that make sence?
 
G

Graham R Seach

As far as I know, you can't add a tab page at runtime - only in design view.

But you can create a few extra pages when you design the tab layout, and set
their Visible property = False. When you need one, just set its Visible
property = True, and set its Caption property to whatever you want.

For example, the following code sets the page's Caption property, moves it
to the 2nd position, then makes it visible:
With Me.tab1
.Pages(2).Caption = "abc"
.Pages(2).PageIndex = 1
.Pages(2).Visible = True
End With

I'm afraid I don't understand what you mean by "...group those different
values..."

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------
 
S

SleeplessTexas

Graham,
Thanks for the information. ...What I meant by grouping those values was
essentially identifying through an SQL statement, a specific column of data
say for example; the Date field which would have 3 rows of one date value and
maybe 5 rows of another date, and by grouping those values I would identify 2
date values. So, the first Tab's caption value would display 09/13/05 while
the second Tab's caption would display 09/14/05....
 
G

Graham R Seach

Geez, I don't know; I'd have to know what the grouping criterion was. The
only way I can think to do it is to sort a recordset:

SELECT myDate FROM myTable ORDER BY myDate

....and then use code to cycle through, retrieving values that meet the
criterion and setting up the tab captions.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------
 
G

Graham R Seach

Well I think if you were to provide a tad more detail we might be able to
come up with something together.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------
 
Top