2 Replies Latest reply on Jun 24, 2010 8:05 AM by brucewashington

    adding a variable

    brucewashington

      Title

      adding a variable

      Post

      MP 11 Advanced  and Windows Vista Business

      I want a field that will take one field (the full name) and add it to a phone number choicing Phone 1 (home phone) first and if empty choosing Phone 2 and if that one is empty choosing Phone 3.

       

      I had it work for two phones only but adding the third, two come in blank.

       

      My two phone variable is:

       

      Case(
      Phone = "" ; Name_Full &" " & Phone3 &" "& Phone3_Ext ;
      Name_Full &" " & Phone &" "& Phone_Ext )

       

      No problem.

       

      How to add the new variable into the equation is what has got me.

       

      Any ideas appreciated.

       

        • 1. Re: adding a variable
          ryan

           


          speakerbruce wrote:

          I want a field that will take one field (the full name) and add it to a phone number choicing Phone 1 (home phone) first and if empty choosing Phone 2 and if that one is empty choosing Phone 3.

           


           

          Hi speakerbruce,

           

          Try adjusting your CASE function in the calculated field to the following: 

           

           

          Name_Full &  &  " "  & Case (

          not IsEmpty ( Phone1 ) ; Phone1 & Phone1_Ext ;

          not IsEmpty ( Phone2 ) ; Phone2 & Phone2_Ext ;

          not IsEmpty ( Phone3 ) ; Phone3 & Phone3_Ext ;

          "" )

           

          This looks at the first phone field, and if it's not empty, it uses it.  and moves on to the next phone field if it is empty.

           

          A CASE function stops at the first TRUE result, just FYI.

           

          One thing to think about:  What happens if there is NO phone number?  whatever the case, you can put that as the last option if all other phone fields are empty.

           

          Also, i just made up the field names for your phone fields 1 & 2.  so you make sure you use your actual field names.





          • 2. Re: adding a variable
            brucewashington

            Thank you so much for this.  I was getting complicated and nowhere.

             

            : )