Expand my Community achievements bar.

Help a Rookie - Doing Date Calculations

Avatar

Level 1

this is my very first form using LiveCycle.

Seem pretty cool and fairly easy to use.

Have run into a slight hitch.   I am doing a date calculation.

I want the user to enter Saturdays Date on the from.

From that date I want the form to provide the date for the previous week.  

For example if the user enters 12/10/2011 for saturdays date I would want Fridays date to show up on the form as 12/09/2011, Thursdays date as 12/08/2009 and so on down the line.  

Reading through the forum I should be doing something along this line here.

 

form1.page1.subform1.friday_date::enter - (FormCalc, client)

friday_date.rawValue = Num2date(Date2Num(saturday_date.formattedValue, "MMM DD, YYYY") -1, "MMM DD, YYYY")

should I be chooseing something besides the enter option - I have tried most of the options that I have.

the problem is I never get the date to appear in the friday_date field.

I feel sure that this problem is something fairly simple, I just do not know how to correct it.

Thanks for helping a rookie out.  

4 Replies

Avatar

Level 4

Hi,

Have you written the script in "FormCalc" language option.

Thanks,

Dev

Avatar

Level 1

Yes I believe that I am

That is what is so confusing.

Avatar

Level 7

You have put the script in the enter event for the friday date so the dat will only appear if you actually enter that field. Try putting it into the calculate event. That way it will appear as soon as someone enters the Saturday value.

Avatar

Level 1

I have not been able to get back to it but I will give it try thanks for the response