AnsweredAssumed Answered

Auto Enter Calculation

Question asked by hrcap on Jul 12, 2013
Latest reply on Jul 12, 2013 by hrcap

Title

Auto Enter Calculation

Post

     Hi Guys

     I need some help if possible.

      

     I have a field called dob_day, this field is used to enter the day of the month that someone was born and so must contain a value 01 - 31.

      

     I have most of my auto enter calculation sorted that ensures that the number is entered in the correct format, e.g if "1" is entered it will turn the number into "01" or if "111" is entered it will turn the number red to show an error.

      

     I wish to modify this auto enter calculation slightly so that it will only allow the entry of the numbers 01 - 31 and if a different number is entered it will turn red.

      

     Below is the calculation that i have so far, i think the part that needs modifying is the if statement with the *** next to it, in particular the part: @Numbers  ≠  ("1" or  "2" or "3") NB: this should go all the way to 31 once the caluclation is correct.

      

      

     Let(
      
     @Numbers = TextFormatRemove (Filter(Self; "0123456789"));
      
     If ( @Numbers  ≠  ("1" or  "2" or "3") ; TextColor ( Self ; RGB(255; 0; 0)) ; (    ********************
      
      
     Case(
      
     Length(@Numbers) = 0 ; 
      
     (@Numbers) ; 
      
     Length(@Numbers) = 1 ;
      
     "0" & @Numbers ;
      
      
     Length(@Numbers) = 2 ; 
      
     (@Numbers) ;
      
      
     TextColor ( Self ; RGB(255; 0; 0))
      
     )
     )
     )
     )
      
     Hopefully i am on the right track.
      
     Thanks in advance for any help.
      
      
     Cheers
      
      
     Hadleigh

Outcomes