11 Replies Latest reply on Jun 3, 2015 12:11 PM by thong127

    Ascending Count

    thong127

      Title

      Ascending Count

      Post

      Hello All.

      I am currently making a label for our containers to be printed in 3 1/2" x 5" White Laser Labels. I want that in my Print Layout the Number of Container will Look like this for example if we received materials with 5 containers: (Container  1 of 5) ;  ( Container 2 of 5 ) ; ( Container 3 of 5 ) ; ( Container 4 of 5 ) & ( Container 5 of 5). 

      Here are the fields of my Data Base

         

                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
      Field NameType
      Material NameText
      Material Lot No.Number
      Received DateDate
      Quantity Received       Number
      UnitsText
      LocationText
      No. of ContainerNumber

       

       

      Can you please help me set up my Print Layout.

      Thank you so much in Advance.

       

        • 1. Re: Ascending Count
          SteveMartino

          Does each label represent one record of a found set?  If so you could create a calculation field:

          Get ( RecordNumber ) & " of "  & Get ( FoundCount )

          Or are you saying you have 5 for the number in  No. of Containers on one record and you want to print 5 labels saying 1 of 5, 2 of 5, etc.?

          Or am I way off and just don't understand :)

          • 2. Re: Ascending Count
            philmodjunk

            Does Qty Received indicate the number of containers (and labels) needed? If not what shows the required number of tables?

            Are you printing Avery type sheets of labels or using a custom label printer that prints a "ribbon" of individual labels such as you get from a Dymo printer?

            It's often best to set up a "Labels" table linked to your existing table with a script that generates the needed labels records by setting a match field to an ID field in your original table. You don't need fields in this table to copy over data as you can use the relationship to enable placing fields from your original table on this labels layout. You only need the ID match field and your number fields for label number of total labels in group and these three fields can get their values from a script that loops through the set of records in your original table for which you need to print labels.

            After you print your labels, you can delete the records your script created in the labels table as they would no longer be needed.

            • 3. Re: Ascending Count
              thong127

              Hi Phil & Steve,

              Thank you for your replies. 

              @Steve, 5 Containers in one record (like for example 100 Kg in total but they put it in 5 containers)

              @ Phil, Yes, Im printing Avery type of Labels" The Avery 05168" 3 1/2" x 5"  4 label sheet. I already make another Table I named it Labels with only Field "LABEL ID MATCH FIELD" which is a number field with auto enter as serial connected to my Product Table "PRODUCT ID MATCH FIELD" which is a number field with auto enter as serial.

              "You only need the ID match field and your number fields for label number of total labels in group and these three fields can get their values from a script that loops through the set of records in your original table for which you need to print labels."

              Phil, Can you please guide me with the underlined words I don't know how to set up this.

              Thank you so much.

              • 4. Re: Ascending Count
                philmodjunk

                To repeat a question not yet answered: Which field in your table determines the number of labels that need be printed for that record?

                • 5. Re: Ascending Count
                  thong127

                  Hi Phil,

                  The field that determines the number of labels that need to be printed for that particular record is the "No. of Container" whis is a number field.

                  • 6. Re: Ascending Count
                    philmodjunk

                    Then if you pull up a found set of record on a layout based on your data table, this script can generate new related records in the Labels table:

                    Go To Record/Request/Page [First]
                    Loop
                        Set Variable [$Labels ; Data::No. of Container]
                        Set Variable [$ID ; value: Data::__pkPrimaryKey ]
                        Go to Layout ["Labels" (Labels) ]
                        Loop
                           Set Variable [$K ; value: $K + 1 ]
                           Exit Loop If [ $K > $Labels ]
                           New Record Request
                           Set Field [Labels::_fkForeignKey ; $ID ]
                           Set Field [Labels::CNumber ; $K ]
                        End Loop
                        Go to layout [original layout]
                    End Loop

                    On your labels layout, this text: <<CNumber>> of <<Data::No. of Container>>

                    will provide the "1 of 3" type entry.

                    Note that this method of switching back and forth between layouts, while commonly used, can trip a very long list of script triggers. There are ways to keep the scripts of any tripped triggers from executing and there are ways to create new records in a related table that rely on a more complex relationship, but do not require changing layouts.

                    • 7. Re: Ascending Count
                      thong127

                      Hi Phil,

                      Thank you so much for the reply, I have a problem with the script because it keeps looping. If I hit the Escape button then it will stop. It is possible to make it the created record in one layout? or make the created number of container in one layout (<<CNumber>> of <<Data::No. of Container>>) I'm using a Avery 3 1/2" x 5" which is 4 label sheets. Please find attached format.

                      Thank you.

                      • 8. Re: Ascending Count
                        philmodjunk

                        Left out a step after the last go to layout:

                        Go to record/request/page [next ; exit after last]

                        • 9. Re: Ascending Count
                          thong127

                          Hi Phil,

                          Is it possible to put the created record in one layout? so that I can print in a 4 label sheet?

                          Thank you.

                          • 10. Re: Ascending Count
                            philmodjunk

                            You can specify a "labels" layout. Using the new layout wizard, you can specify this type of layout and then enter the Avery number to get a layout designed for the sheet labels that you are using.

                            • 11. Re: Ascending Count
                              thong127

                              Thanks Phil,

                              Problem Solved.