View Full Version : Cycle through a collection(?) of pages on a form.
I have a Form with several pages. The command "Me.Page1.visible = False" sets page1 invisible. I have 13 pages, and would like to make them all (at one time or another) invisible. Then depending on other variable input, make a certain page visible.
How do I cycle through all the pages. They (seem) are all in "TabCtl1" on my form.
mud, you use the "Pages Collection" of the Control Tab, I have just used this code to get the number of pages and then set them to invisible.
Dim frm As Form, pagecount As Integer, x as Integer
Dim tbc As TabControl, pge As page
Me.Age.SetFocus
Set frm = Forms!frmPatientData
Set tbc = frm!TabCtl38
pagecount = tbc.Pages.count
For x = 0 To pagecount - 1
tbc.Pages(x).Visible = False
Next x
Note that you have to ensure that "Focus" is not set to any of the "pages".
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.