2 Replies Latest reply on May 8, 2013 3:30 PM by malijames

    Duplicate IF

    malijames

      Title

      Duplicate IF

      Post

       i have this two tables. Student table and session table. The session table is link to the student table with the studentID_FK. I have a layout base on the student table and on the layout is a portal from the session table. I have fields like STATUS , YEAR , LEVEL on the session table. Now I want to attach a script to a button on a new layout based on the session table  which will If STATUS = “regular” duplicate such record and in the duplicate record , change any value in  the field YEAR to 2014 and any text in the  LEVEL field  be changed to grade2 The whole idea is to register any  regular studdent from 2013 session  into the new session (2014) automatically without going to the portal to create a new record for the new session for each student Any idea or suggestion is welcome pls

        • 1. Re: Duplicate IF
          philmodjunk

               If [Session::Status = "Regular" ]
                 Duplicate Record
                 Set Field [Sesssion:Year ; Session::Year + 1]
                 Set Field [Session::Grade ; Session:Grade + 1]
               End If

               I would make grade a numer field, but if it's text the second set field step could be changed to:

               Set Field [ Session::Grade ; Leftwords ( Session::Grade ; 1 ) & " " & GetAsNumber ( Session::Grade ) + 1 ]

          • 2. Re: Duplicate IF
            malijames
             thank phil it works perfectly I will change the grade to a number field Its nice having guys like you on this  Forum Thanks again