10 Replies Latest reply on Aug 11, 2009 2:15 PM by gasolineman

    counting a field

    gasolineman

      Title

      counting a field

      Post

      i know there are lots of threads that talk about counting, but i cant find anything that talks about just what i want to do.

       

      i have a field in my db that is a value list containing the values "open" and "closed"

       

      the field is only entered once per record, and i am wanting a running total of "open" records

       

      is there a way to make a field appear in the form that will show me a running total of "open" records without running a report? 

        • 1. Re: counting a field
          BetoBoton
            

          Hi

          I don't know what you mean by  "running a report"

          But you can just quickly run a script to get the total number of records, the the "open" ones and the "closed will be  "total number of records" - "open"

           

          Make sense?

           

          Hope it helps 

          • 2. Re: counting a field
            raybaudi
              

            gasolineman wrote:

             

            is there a way to make a field appear in the form that will show me a running total of "open" records without running a report? 


            Hi

             

            Two new fields:

             

            1) cOpen : calculated field, result number, and calc: Self = "Open"

            2) sOpen : summary field ( total of cOpen )


            • 3. Re: counting a field
              comment_1
                

              raybaudi wrote:
              calculated field, result number, and calc: Self = "Open"

              That doesn't seem right.


              • 4. Re: counting a field
                raybaudi
                  

                Correct !

                 

                YourListField = "Open"

                • 5. Re: counting a field
                  gasolineman
                    

                  what i have is a database that has a field labeled "Open", it is a value field with 'open' and 'closed' as the two options for radio buttons.  the database has 5000 records and growing everyday of course, and  i am trying to display a field on the form that tells me how many records are 'open' without having to perform a find or creating a report.

                   

                  any ideas? 

                  • 6. Re: counting a field
                    BetoBoton
                      

                    I'll tell you what I've been trying here and MAYBE helps:

                     

                    1-I created, on the same database, a COUNTING table with 2 GLOBAL fields and ONLY one Record (the First one so you can refer to it easily and RELATE IT to your main table)

                    2- In your case they would be GlobalOpen and GlobalClosed ( I have a similar stuff here)

                    3- I created a run ONCE script to  count the Open and Closed and set the FIRST Record of my COUNTING table

                    4 - IF the OPEN RADIO or CLOSED RADIO is changed by user I ADD 1 and Subtract 1 from the appropriate field GlobalOpen and GlobalClosed.

                    5- On New Record CREATION you ADD to the appropriate field GlobalOpen and GlobalClosed

                    6- On New Record DELETION you SUBTRACT to the appropriate field GlobalOpen and GlobalClosed

                     

                    //===================== 

                    It is NOT an elegant way out of this.

                    //=====================

                    But there is No Layout, No  FIND as you wish!

                    In my case it is working and I have the "totals" showing and changing properly.

                     

                    I know  there are some Aggregate functions (that I don't know how to use them) that MAYBE do this, but you never know if my old "count the stuff with your fingers method" is enough for you. 

                     

                    Cheers 

                    Beto 

                    • 7. Re: counting a field
                      philmodjunk
                         Applying Comment's correction to Raybaudi's suggested calculation fields should supply what you need. No scripting is required.
                      • 8. Re: counting a field
                        etripoli
                           BetoBoton - I see many issues with the solution you provided, especially since the revised method RayBaudi provided should work just fine.  Using calculation and summary fields is much less likely to break.
                        • 9. Re: counting a field
                          BetoBoton
                            

                          I probably did not understand the revised method RayBaudi provided!

                           

                          Thanks 

                          • 10. Re: counting a field
                            gasolineman
                               yes, that worked great!  thanks!