3 Replies Latest reply on May 2, 2009 3:33 AM by VanRavensteyn

    showing multiple found records in one form

    VanRavensteyn

      Title

      showing multiple found records in one form

      Post

      How can I make a form that shows not only the first, but also the next found record, in the same form. (not using table or list vieuw)

      example: two records for the field "colour" are found: red an green.

       a form is created with text and the "colour" field:

       

      "The chair is available in the colours "colour" and "colour""

       

      The result will be:

      "The chair is available in the colours red and red"

       

      How do I get the two colour to apear in one form?

       

       

        • 1. Re: showing multiple found records in one form
          mmccarty
            

          I'm not sure if it will work, but maybe try with portals. 

          Create two portals each with only one row and put your color field in both. Sort the first portal in ascending order so that it gets your first color record.  Sort the second portal in descending order so that it gets the other color record. 

           

          If you have a lot of different color options this mite not be feasible, but if it is only two then it could be possible. 

           

          If each chair can have 3 or more colors you mite need to create additional fields to sort with (not quite sure what that would look like)

           

          Hope this works

          • 2. Re: showing multiple found records in one form
            Jade
              

            Hello,

             

             

            To get the two colours, first add a calculation field (two_colours) to your table and check the "do not store calculation results…" checkbox in the storage options.

            The calculation is:

            Colour &  If (Get(FoundCount)  >  Get(RecordNumber) ; " and " & GetNthRecord(Colour;Get(RecordNumber)+ 1) ; "") 

             

            This will result in "red and green"  or just "green" if it is the last record.

             

            On the layout, add a merge field (i.e. <<two_colours>> )

             

            HTH… 

             

            P.S.: If you want to drop the plural ("s") from the word "colours" for the last record, then you can use the following calculation instead:

             

            Let ([X = Get(RecordNumber) ; Y = Get(FoundCount)] ; If(Y  > X; "s "; " ") & Colour & If (Y  >  X ; " and " & GetNthRecord(Colour;X+ 1) ; ""))

             

            On the layout, insert this: 

            The chair is available in the colour<<two_colours>> 

            • 3. Re: showing multiple found records in one form
              VanRavensteyn
                

              Thanks to the both of you. Both solution work, the first only when there's an internal relation in the table. I applied the solution with the calculating field.

               

              With thanks,

              Guy