4 Replies Latest reply on Mar 13, 2013 3:54 AM by hanstrager

    Help to make a radio button that calculates.

    hanstrager

      Title

      Help to make a radio button that calculates.

      Post

           Im trying to make a very simple application to keep track of my reciepts that easily will tell me ho much tax i can get in return etc. and keep track on my spending.

           Ususally I will get VAT back on materials my company is buying, but sometimes I purchase something where i'll not be able to get VAT back.

           I was thinking if there's a possibility to make 2 radio buttons, and use them as swithes..? As a default it's set to VAT, where it automatically will calculate how much the VAT will be, but when I switch to the other button i will leave the VAT out...?

           Hope this makes sense

        • 1. Re: Help to make a radio button that calculates.
          philmodjunk

               Say the value list for your radio button format is: "VAT" ; "No VAT".

               Go to field options for the field you will format with this value list and enter "VAT" in the DAta box on the Auto-Enter tab.

               Now the "VAT" radio button will be automatically selected in each new record, but you can click "No VAT". Let's call this field VATSwitch

               Now modify your existing VAT calculation field to be:

               IF ( VATSwitch = "VAT" ; //put existing calculation here )

          • 2. Re: Help to make a radio button that calculates.
            hanstrager

                 It almost works:

                 I've made 1 radio button - called VATSwitch

                 I've assigned a value list to this radio button with the 2 values VAT and No VAT

                 Then in the data box, in the auto enter tab for my radiobutton (VATSwitch) I put VAT

                 In my field that's calculating the VAT i put:

                 IF ( VATSwitch = "VAT" ; FullAmount * 2)

                  

                 in my VAT calculation field my the full amount gets multiplied with 2, and the VAT radio button is chosen per default.

                 Though I can't switch the VAT radio button off. This I can do if I change the radiobutton into a check box. Im just wondering if it's possible to have 2 radio buttons one for VAT and the other for No VAT. If one is pressed the otherone swtitches off automatically..? so it's more visual, either you press one radiobutton and there's VAT included or you press the other and there's no VAT included..?

            • 3. Re: Help to make a radio button that calculates.
              philmodjunk

                   Since you did this:

                   

                        I've assigned a value list to this radio button with the 2 values VAT and No VAT

                   You should see two radio button values in your field and you should be able to click the "No VAT" radio button to disable the calculation. You should not need to change the radio button format to that of a check box format to do that. What you describe sounds like you set up a value list with only one value instead of two.

              • 4. Re: Help to make a radio button that calculates.
                hanstrager

                     Sorry, just me who was a bit stupid. Works perfectly thank you so much.