4 Replies Latest reply on Jul 20, 2015 3:27 AM by contactmip

    How to set a default value in a radio button field that already exists?

    contactmip

      Hi guys,

       

      Probabily a silly question but no way I can set a default value in a radio button field of already existing records.

       

      It works perfectly well for new ones, of course with auto-enter Data option set to my default value (0).

      I tried to use the calculated value option with something like If ( IsEmpty ( Self ); 0 ; 1).

      What is missing?

       

      Globaly speaking, when creating a new field with default auto-enter Data option in a table with existing records, how to set all the existing records with this default value?

       

      Thanks for your help

       

      Mike

        • 1. Re: How to set a default value in a radio button field that already exists?
          erolst

          contactmip wrote:

          I tried to use the calculated value option with something like If ( IsEmpty ( Self ); 0 ; 1).

          What is missing?

           

          That this calculation would somehow have to be triggered.

           

          Easiest method: Find all records you want to update, then use Replace Feld Contents for the field to set your desired value.

          • 2. Re: How to set a default value in a radio button field that already exists?
            richardsrussell

            Erolst gives the correct answer, but here's a little wrinkle that might help. On the layout where the radio-button field appears, duplicate it and format the duplicate as an edit box. Then do a Find within that edit box for value of "=" (equals nothing, or empty). Then use the "Replace Field Contents" command in that field to insert the desired default value. After that, you can delete the duplicate field from that layout.

             

            Bear in mind that "Replace Field Contents" will set off the "auto-enter modification date" for those records if you have a field that keeps track of date updated. If you do, you may wish to turn off that auto-entry feature until after you've executed the "Replace Field Contents" command.

             

            Remember that "Replace Field Contents" is the Spider-Man command: With great power comes great responsibility. I recommend backing up your database before you start to use it.

            • 3. Re: How to set a default value in a radio button field that already exists?
              erolst

              Richard S. Russell wrote:

              On the layout where the radio-button field appears, duplicate it and format the duplicate as an edit box. Then do a Find within that edit box for value of "=" (equals nothing, or empty). Then use the "Replace Field Contents" command in that field to insert the desired default value. After that, you can delete the duplicate field from that layout.

              While you cannot type into a radio button control, you can paste into it; so typing a '=" somewhere, copying it, switching to Find mode, selecting any value in the radio button set (to give it focus), pasting and launching the Find will also do the trick – without a second field copy.

               

              (This description sounds more complicated than it actually is …)

              • 4. Re: How to set a default value in a radio button field that already exists?
                contactmip

                Thank you very much to both of you.

                I do appreciate!!!

                 

                Have a great summer

                 

                Mike