


Hi i have a form that uses a drop down list to change a date/time field that has been working for a long time but has recently stoped working.
The drop down list has 5 selections that change a date in the date/time field based off another date/time field untill recently has worked fine but now when selection 3-5 are selected the date shown is for example 1-14-1900.
Here is the code used
if (DropDownList1.rawValue == "1")then
form1.Table2.Row3.DateTimeField1.formattedValue
elseif (DropDownList1.rawValue == "2")then
form1.Table2.Row3.DateTimeField1.formattedValue
elseif (DropDownList1.rawValue == "3")then
Num2Date((Date2Num(form1.Table2.Row3.DateTimeField1.formattedValue, "MMM DD, YYYY") + 14), "MMM DD, YYYY")
elseif (DropDownList1.rawValue == "4")then
Num2Date((Date2Num(form1.Table2.Row3.DateTimeField1.formattedValue, "MMM DD, YYYY") + 21), "MMM DD, YYYY")
elseif (DropDownList1.rawValue == "5")then
Num2Date((Date2Num(form1.Table2.Row3.DateTimeField1.formattedValue, "MMM DD, YYYY") + 25), "MMM DD, YYYY")
else null
endif
Any help would be appriciated.
Views
Replies
Total Likes
You have a space in the word 'value' in 'formattedVal ue' for boxes 3-5.
Views
Replies
Total Likes
In the code on the form there is no space i am not sure why it has on there as i copy and pasted the code here.
Views
Replies
Total Likes
You haven't said where you are putting this code, but if it is in a third field (where you want the results to go) then try this:
if (DropDownList1.rawValue == 1)then
$ = form1.Table2.Row3.DateTimeField1.formattedValue
elseif (DropDownList1.rawValue == 2)then
$ = form1.Table2.Row3.DateTimeField1.formattedValue
elseif (DropDownList1.rawValue == 3)then
$ = Num2Date((Date2Num(form1.Table2.Row3.DateTimeField1.formattedValue, "MMM DD, YYYY") + 14), "MMM DD, YYYY")
elseif (DropDownList1.rawValue == 4)then
$ = Num2Date((Date2Num(form1.Table2.Row3.DateTimeField1.formattedValue, "MMM DD, YYYY") + 21), "MMM DD, YYYY")
elseif (DropDownList1.rawValue == 5)then
$ = Num2Date((Date2Num(form1.Table2.Row3.DateTimeField1.formattedValue, "MMM DD, YYYY") + 25), "MMM DD, YYYY")
else null
endif
Views
Replies
Total Likes
This code has the same problem as the one i have.
The code is in the second date field that is a due date which depends on the inpute of the dropdown list and the current date that is in the first date field.
Views
Replies
Total Likes
What is odd is my code starts to work again at april 10th.
Views
Replies
Total Likes