Gents,
I would like to seek your assistance for the code below which recently it gives an error "Run-time error '2100'", but previously is not, meaning i have been using this form and no error, just when i will add or edit something this error comes up.
= = = =
Private Sub Form_Resize()
On Error Resume Next
Const conBorderDistance As Integer = 100 'Distance of all controls to the form's boundaries
Const conTV_Width = 3000 'The width of the treeview (the subform will use the remaining space)
Const conTV_HeightDeviation As Integer = -5 'The treeview will be slightly higher than an access-control
Painting = False 'This will avoid the form flickernig while being resized
'Reset the controls (in case form is now smaller than before)
With tvSB
.Left = 0
.Top = 0
.Height = 0
.Width = 0
End With
With Switchboard_Subform
.Left = 0
.Top = 0
.Height = 0
.Width = 0
End With
'Adjust detail-section's size
Me.Section(acDetail).Height = Me.InsideHeight _
- Me.Section(acFooter).Height - Me.Section(acHeader).Height
'Reposition the controls
With tvSB
.Left = conBorderDistance
.Width = conTV_Width
.Top = conBorderDistance
.Height = Me.Section(acDetail).Height - conBorderDistance * 2
End With
With Switchboard_Subform
.Left = tvSB.Left + tvSB.Width + conBorderDistance
.Width = InsideWidth - tvSB.Width - conBorderDistance * 3
.Top = conBorderDistance
.Height = tvSB.Height + conTV_HeightDeviation
End With
Painting = True
End Sub
===
Appreciate your kind assistance.
Many thanks.