I have a Form with two dates fields, named From_picker and TO_picker. Also i create a button and a label outside the form. I test the formula bellow, where i create a variable that i assigned to a label to show the result. Unfortunately nothing is calculated and i don't know why.
If i used two fields that are not part of the form it's working...
Set(varDateDiff,(DateDiff(From_picker.SelectedDate,TO_picker.SelectedDate,Days)))