14 Replies Latest reply on Aug 9, 2012 12:11 PM by comment

    Buttons to Edit Cells

    pakreb

      Does anyone know how to link buttons to edit cells?

       

      Here's my scenario;

       

      I have to do a manual election count. I'll have 4 things in a group: first thing will be the "Name" cell; the second will be the "Count" cell; the third thing will be a "+1" button and the fourth thing will be a "-1" button.... "John Smith" will be in the first cell, when John Smith gets a vote, I push the +1 button and the Count cell begins showing numbers starting with (of course) 1. If I accidentally gave John Smith a vote, then I push the -1 button which would take a vote away.

      I could have multiple names so, I will have multiple groups, but each group should do the above.

       

      Anyone have any ideals?

       

      Thanks, pakreb

        • 1. Re: Buttons to Edit Cells
          MattLeach

          The + and - buttons would need to have a script step attached that would edit the contents of the Count Field.

           

          For Adding

          Set Field [Table::Counts; Counts + 1]

           

          For Subtracting.

          Set Field [Table::Counts; Counts - 1]

          • 2. Re: Buttons to Edit Cells
            comment

            pakreb wrote:

             

            If I accidentally gave John Smith a vote, then I push the -1 button

             

            I think you are right to be concerned and perhaps should rethink the entire method. It's too easy to become confused and be forced to start from the very beginning.

             

            At minimum, IMHO, you should create a record for each vote (including corrections). If possible, with the ID of the voter or - if these are secret ballots - perhaps with a random number generated for each voter in turn.

            • 3. Re: Buttons to Edit Cells
              pakreb

              Matt, I did that but the count field won't populate. I'm assuming that the count field is an edit box, right?

              • 4. Re: Buttons to Edit Cells
                MarcDolley

                Yes. Your Count field is a number field which is enterable in browse mode. You don't even need scripts. Just two buttons, one which does a set field to Count + 1 and one which does a set field Count - 1. Having said that, I would probably expand the calculations to the following:

                 

                SetField [Count; If(IsEmpty(Count); 1; Count + 1)] and

                SetField [Count; If(IsEmpty(Count); 0; Count - 1)]

                 

                Unless you're planning on using this to count votes in the upcoming US presidential elections and have to conform to lots of regulations, this should be sufficient.

                 

                Regards

                Marc

                • 5. Re: Buttons to Edit Cells
                  comment

                  MarcDolley wrote:

                   

                  Having said that, I would probably expand the calculations to the following:

                   

                  SetField [Count; If(IsEmpty(Count); 1; Count + 1)]

                   

                  You don't trust empty + 1 to produce 1?

                   

                   

                   

                  MarcDolley wrote:

                   

                  Unless you're planning on using this to count votes in the upcoming US presidential elections

                   

                  Despite your jab, I would still recommend keeping a trail.

                  • 6. Re: Buttons to Edit Cells
                    pakreb

                    You're talking about a very complex software!

                    If I have (say) 10 names and each voter have to choose 5 out of ten, then each time the five is counted, the page would have to refresh in order to generate a new random number, right?  which means that the count fields would have to maintain the current count when it refreshes.

                    I'm used to MicroSoft "Works", not "Access", meaning I'm not proficient at FileMaker type database designs.

                     

                    Ps. I'm using FileMaker 9 Pro, not 12 Pro, so I'm hoping that the suggestions will work in 9 as well.

                     

                    Thanks.

                    • 7. Re: Buttons to Edit Cells
                      comment

                      pakreb wrote:

                       

                      You're talking about a very complex software!

                       

                      Not really - though it would be more sophisticated than a spreadsheet and require at least modest scripting skills.

                      • 8. Re: Buttons to Edit Cells
                        pakreb

                        Hi Michael,

                         

                        You sound like you're quite versed on FileMaker designs. Do you think that it would be easier if instead of a button, I use a check box after each name, then, when I check no more than five names and hit an "Enter" button that it would enter the counts in the count fields? Though there would have to be a fault alert if more than five boxes are checked.

                        What do you think?

                         

                         

                         

                         

                        Date: Fri, 27 Jul 2012 11:23:45 -0700

                        From: noreply@filemaker.com

                        To: pakreb@hotmail.com

                        Subject: Re: Buttons to Edit Cells

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                         

                        created by Michael Horak in Layout Design - View the full discussion

                        • 9. Re: Buttons to Edit Cells
                          comment

                          Could you explain in more detail what this is about? So far, I think we have heard more about possible solutions than about the problem itself.

                          • 10. Re: Buttons to Edit Cells
                            pakreb

                            OK,

                            I'm in charge of counting votes on an election of my Home Owners Association's annual Board of Directors. The home owners get a ballot of all of the Candidates. Each home owner must choose no more than 5 candidates and must mail their ballots in, then during the night of the election, the ballots must be counted. Of course, if there is only 5 candidates, there won't be an election. If there is more than 5 candidates, then I want to put their names in my iPad and keep count with my iPad. I have a FileMaker Go app in my iPad that can function, but can't design.

                            So...

                             

                             

                             

                             

                            Date: Fri, 27 Jul 2012 14:41:56 -0700

                            From: noreply@filemaker.com

                            To: pakreb@hotmail.com

                            Subject: Re: Buttons to Edit Cells

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                             

                            created by Michael Horak in Layout Design - View the full discussion

                             

                             

                             

                            Could you explain in more detail what this is about? So far, I think we have heard more about possible solutions than about the problem itself.

                             

                            Reply to this message by replying to this email -or- go to the message on FileMaker Technical Network

                            Start a new discussion in Layout Design by email or at FileMaker Technical Network

                            Manage your email preferences.

                             

                            FileMaker Developer Conference 2012 • Miami, Florida • July 16-19 • www.filemaker.com/devcon

                            • 11. Re: Buttons to Edit Cells
                              pakreb

                              Hi MarcDolley,

                               

                              Well, I guess what I want to do just won't work. I tried the formula you suggested, but it didn't work, so, I guess what I want to do is not possible with FileMaker.

                               

                              Thanks anyway,

                              pakreb

                              • 12. Re: Buttons to Edit Cells
                                comment

                                Have a look at the file posted here:

                                http://fmforums.com/forum/showpost.php?post/233897/

                                 

                                Computers -> Voters

                                Software -> Candidates

                                Installations -> Votes

                                • 13. Re: Buttons to Edit Cells
                                  pakreb

                                  Thanks to all of the comments and suggestions, but since none of the suggestions were functional, I'm assuming that FileMaker is not capable of taking care of my dilema. Perhaps Access is capable, but unfortunately, I can't run Access in my iPad. Oh well!

                                  • 14. Re: Buttons to Edit Cells
                                    comment

                                    pakreb wrote:

                                     

                                    I'm assuming that FileMaker is not capable of taking care of my dilema.

                                     

                                    Well, that's one possible conclusion...