レポートで演算するフィールドを自動で指定する方法

テーブルもしくはクエリの複数フィールドを自動的にある条件で指定し演算したい場合がある。

これを実行するには以下のように、各フィールドを配列とし定義することで可能となる。

Array 関数の使用

  Dim myDat as Vriant

    myDat = Array(“field1″,”Field2″,”Field3”)

※例:myDat(2)はField3となります。

これで()内の数値を演算式でしていすることで何番目のFieldを指定することができます。

 

UBoundとLBoundを使用し自動でFieldを指定

Dim myDat as Vriant
Dim i as Integer

    myDat = Array(“field1″,”Field2″,”Field3”)  
    For i = LBound(myDat) to UBound(myDat)

        ・・・ 処理 ・・・

    Next

※これで配列MyDatの最小0から最大2までが実行されます。

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny

タイトルとURLをコピーしました