6 Replies Latest reply on May 19, 2016 10:01 AM by jgomes384

    Check Box Auto Checking

    ZoocMan85

      I have two fields  Beers Drank and Active Slots Completed

       

      What i want to do is on layout entry, is have a script check both fields. If in beers drank the number 17 exists, then it should check it off in the field Active slots completed . Checkbox # 17. How do i do this ?

       

       

      Screen Shot here

       

      screenshot.jpg

        • 1. Re: Check Box Auto Checking
          SteveMartino

          There is really no idea what is going on here, as far as how the database is set up, relationships, etc.

          How is the top part populated?

          For example (and it's a little hard to read)

          21 Shower Beer.  Is that 2 different fields?

          How is the 21 entered?

          Can the number 21 only appear once?

          What does the 21 stand for in the top part and the Completed slots?  Are they related, 2 separate tables, etc.?

          What do you do after you have the checkboxes checked?  Do you need a report?

           

          Also, 'Beers Drank' sounds rough...maybe Beer Consumed?

          • 2. Re: Check Box Auto Checking
            ZoocMan85

            Its hard to read on screen but that doesn't matter. It looks fine on a print out.

             

            Brews Drank is a populated value list from Beer History table.  Slot Number ,Beer Name, Customer ID are the fields in that table.  Tables are related by customer ID.

             

            I dont need a report all i want is is the two fields to compare. If Slot 17 exists in Beers Drank then it should be checked off in Slots Completed field.

            • 3. Re: Check Box Auto Checking
              dtcgnet

              Some thoughts...

              Create a new calculated field: SlotList. Make it type "text". The formula is:

               

              List ( Beer History::Slot Number )

               

              Make a value list which uses the "Slot Number" field to create the available values (1, 2, 3, etc.).

               

              Put the field called "SlotList" on your layout. Make it a "Checkbox Set".

               

              Since your system is already properly displaying all of the beers drank for that table, that ought to do it for you.

              1 of 1 people found this helpful
              • 4. Re: Check Box Auto Checking
                jgomes384

                Is Slots Completed a field in a related table to Brews Drank, or a field within Brews Drank?

                 

                If it's related, you could set the field as a calculation List ( Brews Drank::Slot Number )

                 

                or

                 

                In either case you could set the field definition to calculate ExecuteSQL ("SELECT DISTINCT(\"Slot Number\") FROM \"Brews Drank\"") ; "" ; "" )

                 

                Then on the layout it will show each checked off as you add new consumed brews.

                 

                -Jason

                • 5. Re: Check Box Auto Checking
                  dtcgnet

                  jgomes384 wrote:

                   

                  Is Slots Completed a field in a related table to Brews Drank, or a field within Brews Drank?

                   

                  If it's related, you could set the field as a calculation List ( Brews Drank::Slot Number )

                   

                  or

                   

                  In either case you could set the field definition to calculate ExecuteSQL ("SELECT DISTINCT(\"Slot Number\") FROM \"Brews Drank\"") ; "" ; "" )

                   

                  Then on the layout it will show each checked off as you add new consumed brews.

                   

                  -Jason

                  Modified for each customer:

                   

                  ExecuteSQL ("SELECT DISTINCT(\"Slot Number\") FROM \"Brews Drank\"") WHERE CustomerID = ?" ; "" ; "" ; Brews Drank::Customer ID )

                  • 6. Re: Check Box Auto Checking
                    jgomes384

                    I was just about to amend that in there! Thanks!