4 Replies Latest reply on Jun 11, 2013 5:17 AM by lfolkestad

    how to make the drop down menu for a field to say "green" "blue" "red" but enter 1 - 2 - 3 into the...

    lfolkestad

      Title

      how to make the drop down menu for a field to say "green" "blue" "red" but enter 1 - 2 - 3 into the database

      Post

           I am a noob and probably just dont know what its called so i cannot search the fantastic forums for help.

           I have a lot of fields of catagorical data eg group color "red", "green", "blue". But seeing i am going to use the db to enter data into that i am later going to export - import into a statistics package for further analysis - it would be nice if the data that was entered into the db was 1, 2, 3. 

           I am not going to be doing all of the data entery my self so i cannot use 1, 2, 3 as labels seeing that the other that put data into my database do not know the 'codes'.

           So question 1: How do i make the field drop down menu go: red, green, blue - whilst the data registered is 1,2,3

           question 2: How do i make a check box that registeres 0 into the database if the box is unchecked and 1 if checked.

           hope some of this made sense to anybody other than me.

           thank you.

           lars

        • 1. Re: how to make the drop down menu for a field to say "green" "blue" "red" but enter 1 - 2 - 3 into the...
          philmodjunk

               1)

               Option 1: Use two fields. Set up field 1 with your value list and set up Field 2 as a calcuation field with a case function that returns the correct number value for the text entered into the field with the drop down. Select your value in field 1, but export the data from field 2.

               Option 2: Set up a table of related values, with one value in each record of this table. Use two fields, one for th numeric value and one for the text. Set up your valuelist to list values with the Numeric field selected as field 1 and the text field selected as field 2. There's an option that you can select to only show values from the second field so that the text is shown in the list, but the number is entered.

               2) Define a value list with just 1 as the only custom value. Add an auto-enter calculation with this expression to change the value to zero when the check box is cleared: If ( IsEmpty ( Self ) ; 0 ; self ) and clear the "do not replace existing value" check box. Also, enter a 0 in the data box on this same tab so that each new record always starts with 0 in this field. Note that you can resize this field so that the 1 is not visible--just the check box.

          • 2. Re: how to make the drop down menu for a field to say "green" "blue" "red" but enter 1 - 2 - 3 into the...
            IT_User

                  

                 Hello!

                 Sounds like you are having fun with Value Lists.

                 Do what PhilModJunk says, because he is pretty good at this, as far as I'm concerned.  OR if you want to read on, just to give options...

                 Question 2: I always have a value list that is called Bool_One, and all it has is the static value 1 and nothing else.  When checked it would have the value as 1, and not checked it is empty.  If "0" is necessary to be recorded use a radio button.

                 Question 1: So when I need a numeric value for something that has text, I usually have a separate table with those values.  Then I make a value list that has "Use value from field" and the first value is the numeric field, and the second is the text.  Then I choose "Shown values only from second field".

                 Hope That Helps (HTH)

            • 3. Re: how to make the drop down menu for a field to say "green" "blue" "red" but enter 1 - 2 - 3 into the...
              lfolkestad

                   Thank you both. I love this forum. And IT_User, i think your right, PhilModJunk - knows his File Maker.

                    

                   I have'nt had time to mess around with question 1, but i think i did something horrably wrong regarding question 2, i did as Phil said:

              Add an auto-enter calculation with this expression to change the value to zero when the check box is cleared: If ( IsEmpty ( Self ) ; 0 ; self ) and clear the "do not replace existing value" check box. Also, enter a 0 in the data box on this same tab so that each new record always starts with 0 in this field.

                    

              Now when i try to export (wanted to see what the data looked like) It crashes filemaker so bad that i have to restart the computer to get it working again. 

              any clue to why that is?

              lars

                    

              • 4. Re: how to make the drop down menu for a field to say "green" "blue" "red" but enter 1 - 2 - 3 into the...
                lfolkestad

                     Works like a charm, the problem with export was that when i exportet to xls - FMp crashed. This is due to the fact that i use OS 10.8.3 and thus lack Rosetta. When i export to xlsx there is no problem.