Выравнивание всплывающей формы по нижнему левому краю поля
Private Sub TestTextPole01_Click()
Dim lNew&, tNew&, lNewPlus&
DoCmd.OpenForm "ВсплывающаяФорма"
With Forms("ВсплывающаяФорма")
If Me.RecordSelectors = True Then
lNewPlus = 180
Else
lNewPlus = -80
End If
lNew = Me.TestTextPole01.Left + lNewPlus
tNew = Me.Section(acHeader).Height + Me.TestTextPole01.Top + Me.TestTextPole01.Height
.Move lNew, tNew
End With
End Sub
Если Текущая форма тоже всплывающая ...
Private Sub Поле0_DblClick(Cancel As Integer)
Dim lNew&, tNew&, lNewPlus&, tNewPlus&
DoCmd.OpenForm "Form2"
With Forms("Form2")
If Me.RecordSelectors = True Then
lNewPlus = 200
Else
lNewPlus = -80
End If
If Me.ControlBox = True Then
tNewPlus = 500
End If
lNew = Me.WindowLeft + Me.Поле0.Left + lNewPlus
If FormHasHeader = True Then
tNew = Me.WindowTop + Me.Section(acHeader).Height + Me.Поле0.Top + Me.Поле0.Height + tNewPlus
Else
tNew = Me.WindowTop + Me.Поле0.Top + Me.Поле0.Height + tNewPlus
End If
.Move lNew, tNew
End With
End Sub
Private Function FormHasHeader() As Boolean
Dim bVal As Boolean
On Error GoTo FormHasSections_Err
bVal = Me.Section(acHeader).Visible
FormHasHeader = True
Exit Function
FormHasSections_Err:
FormHasHeader = False
Err.Clear
End Function
|