Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Need Help with a drop down list

Avatar

Avatar
Level 1
William_wm
Level 1

Likes

0 likes

Total Posts

11 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
William_wm
Level 1

Likes

0 likes

Total Posts

11 posts

Correct Reply

0 solutions
View profile
William_wm
Level 1

02-04-2014

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.

Accepted Solutions (0)

Answers (5)

Answers (5)

Avatar

Avatar
Level 1
William_wm
Level 1

Likes

0 likes

Total Posts

11 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
William_wm
Level 1

Likes

0 likes

Total Posts

11 posts

Correct Reply

0 solutions
View profile
William_wm
Level 1

03-04-2014

What is odd is my code starts to work again at april 10th.

Avatar

Avatar
Level 1
William_wm
Level 1

Likes

0 likes

Total Posts

11 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
William_wm
Level 1

Likes

0 likes

Total Posts

11 posts

Correct Reply

0 solutions
View profile
William_wm
Level 1

03-04-2014

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.

Avatar

Avatar
Validate 1
Level 5
whyisthisme
Level 5

Likes

41 likes

Total Posts

324 posts

Correct Reply

59 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 5
whyisthisme
Level 5

Likes

41 likes

Total Posts

324 posts

Correct Reply

59 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
whyisthisme
Level 5

02-04-2014

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

Avatar

Avatar
Level 1
William_wm
Level 1

Likes

0 likes

Total Posts

11 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
William_wm
Level 1

Likes

0 likes

Total Posts

11 posts

Correct Reply

0 solutions
View profile
William_wm
Level 1

02-04-2014

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.

Avatar

Avatar
Validate 1
Level 5
whyisthisme
Level 5

Likes

41 likes

Total Posts

324 posts

Correct Reply

59 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 5
whyisthisme
Level 5

Likes

41 likes

Total Posts

324 posts

Correct Reply

59 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
whyisthisme
Level 5

02-04-2014

You have a space in the word 'value' in 'formattedVal ue' for boxes 3-5.