1Function ShuffleUp(frm As Form)
2On Error Resume Next
3Dim ctl As Control
4Dim ipos As Integer
5Dim pg As Control
6Dim bShift As Boolean
7For Each pg In frm.Controls
8 If pg.ControlType = acPage Then
9 bShift = False
10 For Each ctl In frm.Controls
11 If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox _
12 Or ctl.ControlType = acCheckBox Or ctl.ControlType = acOptionButton _
13 Or ctl.ControlType = acListBox Then
14 If ctl.Visible = True And ctl.Parent.Name = pg.Name Then
15 If ctl.HelpContextId = 1 Then bShift = False
16 If bShift = False Then
17 ipos = ctl.Top + ctl.Height
18 bShift = True
19 Else
20 If ctl.ControlType = acCheckBox Or ctl.ControlType = acOptionButton Then
21 ctl.Top = ipos + 60: ctl.Controls(0).Top = ipos + 20
22 Else
23 ctl.Top = ipos: ctl.Controls(0).Top = ipos
24 End If
25 ipos = ipos + ctl.Height
26 End If
27 End If
28 End If
29 Next ctl
30 End If
31Next pg
32End Function