How do I make sure the user enters an end date that is greater than the start date, not before?
Solved! Go to Solution.
Use this code in the DisplayMode property of your form's submit button to disable it when the date selected is invalid.
If(DatePicker_StartDate.SelectedDate > DatePicker_EndDate.SelectedDate, DisplayMode.Edit, DisplayMode.Disabled)
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
You can notify the user when the end date is selected. So in the Onselect property of the end date picker;
If(StartDate.SelectedDate>EndDate.SelectedDate, Notify ("Endate Should be equal or greater than start date",Error))
You can also place the formula on a Button instead of the Date picker so that the user can't save the form untill the right date is selected.
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Hi @Dushy,
There are many ways to achieve your purpose, depends on which way you prefer.
1. If you want to disable users to enter a date that is not allowed, you can limit the submit button--- use the solution provided by @mdevaney or the solution provided by @eka24 .
2. If you just want to have a reminder to tell users that the entered end date is less than start date, you can add a label under the End Date, set the Text property of label to “Note: Your EndDate is less than StartDate”, and set the Visible property to below:
If(DatePicker_End>=DatePicker_Start, false,true)
This time, if end date is less than start date, the label will display to remind users.
3. If you want to review all the records in a gallery, and want to directly see if EndDate is greater than StartDate, you can add a label and set its Text property to:
DateDiff(ThisItem.StartDate,ThisItem.EndDate)
This time, you can directly see the the difference between EndDate and StartDate(if the number is greater than 0, it means the EndDate is greater than StartDate):
Best Regards,
Allen
Use this code in the DisplayMode property of your form's submit button to disable it when the date selected is invalid.
If(DatePicker_StartDate.SelectedDate > DatePicker_EndDate.SelectedDate, DisplayMode.Edit, DisplayMode.Disabled)
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
You can notify the user when the end date is selected. So in the Onselect property of the end date picker;
If(StartDate.SelectedDate>EndDate.SelectedDate, Notify ("Endate Should be equal or greater than start date",Error))
You can also place the formula on a Button instead of the Date picker so that the user can't save the form untill the right date is selected.
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Hi @Dushy,
There are many ways to achieve your purpose, depends on which way you prefer.
1. If you want to disable users to enter a date that is not allowed, you can limit the submit button--- use the solution provided by @mdevaney or the solution provided by @eka24 .
2. If you just want to have a reminder to tell users that the entered end date is less than start date, you can add a label under the End Date, set the Text property of label to “Note: Your EndDate is less than StartDate”, and set the Visible property to below:
If(DatePicker_End>=DatePicker_Start, false,true)
This time, if end date is less than start date, the label will display to remind users.
3. If you want to review all the records in a gallery, and want to directly see if EndDate is greater than StartDate, you can add a label and set its Text property to:
DateDiff(ThisItem.StartDate,ThisItem.EndDate)
This time, you can directly see the the difference between EndDate and StartDate(if the number is greater than 0, it means the EndDate is greater than StartDate):
Best Regards,
Allen
User | Count |
---|---|
122 | |
87 | |
86 | |
75 | |
67 |
User | Count |
---|---|
214 | |
180 | |
137 | |
96 | |
83 |