I have an icon that Cancels a user's edits on a form by doing a ResetForm(frmRequest).
The form visually resets but I know that it's leaving underlying data selections in place.
I discovered this in an effort to ensure a date control only allows future dates.
An If checks DatacardDate.Default and DateControl.SelectedDate to determine if either are wrong and then the save button doesn't work. Although I realize as I type this I'll have to fix that logic since tomorrow becomes yesterday eventually and my DatacardDate.Default will be in the past.
At any rate, this logic works correctly and the Save icon is disabled so you can't proceed.
If you fix it you can submit the form and all is good.
The cancel icon however, resets the form visually but I know that DateControl.SelectedDate is still the old date because the icon is still disabled after doing ResetForm.
So how do I clear DateControl and where should I do it?
I can't Reset the control within a form from outside which I tried first.
Should or do I need to, add another control inside the form that I can use to clear and cancel instead of outside where I have the Save and Edit icons/controls?