2 Replies Latest reply on Oct 24, 2012 10:18 AM by dscott23

    Calculation Field



      Calculation Field


           This is so simple..Hopefully, I'm just stuck on stupid.

           I have two fields in the same table.

           Field 1 is named Sexual Orientation and the value list entries allowed are:







           Field 2, (which I've set up as a calculation field) is named MSM (short for Men who have Sex with Men)

           I need the MSM field to auto populate with the value Yes when the Sexual Orientation field = "Homosexual" or "Bisexual"

           As we have the need to search for records where MSM=yes

           Thank You.


        • 1. Re: Calculation Field

               A key detail is what format will be used with the value list for field 1. Some formats (check box groups) permit selecting multiple values and others (Radio buttons, pop up menus) do not*. From the context, it would appear that only a single value will be selected and I will work from that assumption:

               If ( field1 = "homosexual" or field2 = "Bisexual" ; "yes" )

               and select "text" as your return type.

               Or ust use:

               field1 = "homosexual" or field2 = "Bisexual"

               and select number as your return type and use boolean formatting to format values of 1 (True) to display as "Yes".

               *In actuality, it IS possible to select multiple values in pop up menus and radio buttons if the user holds the shift key down while selecting a value. I recommend using a validation rule or a script trigger to prevent this, just in case an "in the know" user decides to mess with your database by selecting multiple values.

          • 2. Re: Calculation Field

                 Thanks Phil.

                 Based on the format you sent over, I was able to get this to work using the following:

                 If (Sexual Orientation = "homosexual" or Sexual Orientation = "bisexual" ; "Yes")

                 Thanks so much.