hatena
hatena
2020/09/06 (日) 19:03:08
下記の関数を作成して、
Public Sub CtlVCenter2(ReportName As String, ControlName As String, ControlName1 As String, ControlName2 As String)
DoCmd.OpenReport ReportName, acViewDesign
Dim R As Access.Report
Set R = Reports(ReportName)
Dim C As Access.Control
Set C = R.Controls(ControlName)
Dim C1 As Access.Control
Set C1 = R.Controls(ControlName1)
Dim C2 As Access.Control
Set C2 = R.Controls(ControlName2)
C.Top = (C1.Top + C2.Top) / 2
End Sub
イミディエイトで下記を実行。
Call CtlVCenter2("レポート名", "フィールド3", "フィールド1", "フィールド2")
以上でどうでしょうか。
通報 ...