A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

List controls on a tab page?



 
 
Thread Tools Display Modes
  #1  
Old November 25th, 2008, 02:09 AM posted to microsoft.public.access.queries
John
external usenet poster
 
Posts: 20
Default List controls on a tab page?

Hi,

I have a form that has a tab strip with 4 or 5 tabs on it. I'm trying to
write some code that will list all the controls on a specific tab page.
I can get it to loop through all controls on the form, but I can't seem
to narrow it down to the tab page in question. Any thoughts?

Thanks,

John
  #2  
Old November 25th, 2008, 04:31 AM posted to microsoft.public.access.queries
tina
external usenet poster
 
Posts: 1,997
Default List controls on a tab page?

the following code will loop through the controls on each tabpage of the
named tab control, as

Dim tPage As Page, ctl As Control

For Each tPage In Me!TabCtl0.Pages
For Each ctl In tPage.Controls
MsgBox tPage.Name & ": " & ctl.Name
Next
Next

if, instead, you want to specify what page the code should loop through, use

Dim tPage As Page, ctl As Control

Set tPage = Me!TabCtl0.Pages("PageName")

For Each ctl In tPage.Controls
MsgBox tPage.Name & ": " & ctl.Name
Next

in either case, replace TabCtl0 with the correct name of your tab control,
and in the second case, replace PageName with the correct name of the page
you're concerned with.

hth


"John" wrote in message
ng.com...
Hi,

I have a form that has a tab strip with 4 or 5 tabs on it. I'm trying to
write some code that will list all the controls on a specific tab page.
I can get it to loop through all controls on the form, but I can't seem
to narrow it down to the tab page in question. Any thoughts?

Thanks,

John



  #3  
Old November 25th, 2008, 04:34 AM posted to microsoft.public.access.queries
tina
external usenet poster
 
Posts: 1,997
Default List controls on a tab page?

and btw, "queries" in this newsgroup name refers to Access queries, that is,
SQL statements. you might have done better to post this particular question
to microsoft.public.access.modulesdaovba newsgroup. not a major issue, it's
just good to keep in mind which newsgroup is most focused on the central
theme of your question when choosing where to post.

hth


"tina" wrote in message
...
the following code will loop through the controls on each tabpage of the
named tab control, as

Dim tPage As Page, ctl As Control

For Each tPage In Me!TabCtl0.Pages
For Each ctl In tPage.Controls
MsgBox tPage.Name & ": " & ctl.Name
Next
Next

if, instead, you want to specify what page the code should loop through,

use

Dim tPage As Page, ctl As Control

Set tPage = Me!TabCtl0.Pages("PageName")

For Each ctl In tPage.Controls
MsgBox tPage.Name & ": " & ctl.Name
Next

in either case, replace TabCtl0 with the correct name of your tab control,
and in the second case, replace PageName with the correct name of the page
you're concerned with.

hth


"John" wrote in message
ng.com...
Hi,

I have a form that has a tab strip with 4 or 5 tabs on it. I'm trying to
write some code that will list all the controls on a specific tab page.
I can get it to loop through all controls on the form, but I can't seem
to narrow it down to the tab page in question. Any thoughts?

Thanks,

John





  #4  
Old November 25th, 2008, 01:10 PM posted to microsoft.public.access.queries
[email protected]
external usenet poster
 
Posts: 11
Default List controls on a tab page?

On Nov 24, 11:34*pm, "tina" wrote:
and btw, "queries" in this newsgroup name refers to Access queries, that is,
SQL statements. you might have done better to post this particular question
to microsoft.public.access.modulesdaovba newsgroup. not a major issue, it's
just good to keep in mind which newsgroup is most focused on the central
theme of your question when choosing where to post.

hth

"tina" wrote in message

...



the following code will loop through thecontrolson each tabpage of the
namedtabcontrol, as


* * Dim tPage As Page, ctl As Control


* * For Each tPage In Me!TabCtl0.Pages
* * * * For Each ctl In tPage.Controls
* * * * * * MsgBox tPage.Name & ": *" & ctl.Name
* * * * Next
* * Next


if, instead, you want to specify what page the code should loop through,

use

* * Dim tPage As Page, ctl As Control


* * Set tPage = Me!TabCtl0.Pages("PageName")


* * For Each ctl In tPage.Controls
* * * * MsgBox tPage.Name & ": *" & ctl.Name
* * Next


in either case, replace TabCtl0 with the correct name of yourtabcontrol,
and in the second case, replace PageName with the correct name of the page
you're concerned with.


hth


"John" wrote in message
ing.com...
Hi,


I have a form that has atabstrip with 4 or 5 tabs on it. I'm trying to
write some code that willlistall thecontrolson a specifictabpage.
I can get it to loop through allcontrolson the form, but I can't seem
to narrow it down to thetabpage in question. Any thoughts?


Thanks,


John- Hide quoted text -


- Show quoted text -


Thanks - that worked perfectly
  #5  
Old November 26th, 2008, 03:23 AM posted to microsoft.public.access.queries
tina
external usenet poster
 
Posts: 1,997
Default List controls on a tab page?

you're welcome


wrote in message
...
On Nov 24, 11:34 pm, "tina" wrote:
and btw, "queries" in this newsgroup name refers to Access queries, that

is,
SQL statements. you might have done better to post this particular

question
to microsoft.public.access.modulesdaovba newsgroup. not a major issue,

it's
just good to keep in mind which newsgroup is most focused on the central
theme of your question when choosing where to post.

hth

"tina" wrote in message

...



the following code will loop through thecontrolson each tabpage of the
namedtabcontrol, as


Dim tPage As Page, ctl As Control


For Each tPage In Me!TabCtl0.Pages
For Each ctl In tPage.Controls
MsgBox tPage.Name & ": " & ctl.Name
Next
Next


if, instead, you want to specify what page the code should loop through,

use

Dim tPage As Page, ctl As Control


Set tPage = Me!TabCtl0.Pages("PageName")


For Each ctl In tPage.Controls
MsgBox tPage.Name & ": " & ctl.Name
Next


in either case, replace TabCtl0 with the correct name of yourtabcontrol,
and in the second case, replace PageName with the correct name of the

page
you're concerned with.


hth


"John" wrote in message
ing.com...
Hi,


I have a form that has atabstrip with 4 or 5 tabs on it. I'm trying to
write some code that willlistall thecontrolson a specifictabpage.
I can get it to loop through allcontrolson the form, but I can't seem
to narrow it down to thetabpage in question. Any thoughts?


Thanks,


John- Hide quoted text -


- Show quoted text -


Thanks - that worked perfectly


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:31 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.