![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jan 2006
Posts: 2
Rep Power: 0
![]() |
I have a custom excel form and a list of checkboxes inside the form. When checked, it will print a particular table on one page. I also have a button to print the entire booklet at once. This will cycle through all controls and check them if they are a checkbox. The problem is it seems to do so in a random manner. The code for the buttonn pressed is as follows:
Private Sub cmdBooklet_Click() Dim pPage As Page Dim cCont As Control For Each pPage In MultiPage1.Pages For Each cCont In pPage.Controls If TypeName(cCont) = "CheckBox" Then cCont.Value = True End If Next cCont Next pPage End Sub Is there a way i can loop through the controls in a particular order? The tab order doesn't seem to do much. Thanks for your help |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
|
maybe you should try using the GetNextControl method.
according to MSDN this... "Retrieves the next control forward or back in the tab order of child controls." 'Get the first control in the tab order.
Dim ctl As Control = Me.GetNextControl(Me, True)
Do Until ctl Is Nothing
'Use ctl here.
'Get the next control in the tab order.
ctl = Me.GetNextControl(ctl, True)
Loophere's the link: http://msdn.microsoft.com/library/de...ntroltopic.asp
__________________
I have never let my schooling interfere with my education. -Mark Twain- Xbox live gamertag: melbolt |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|