I am attempting to provide a training module for work relating to Motor Claims.
The end user must select an incident date. There is a check in place to ensure it is not in the future but I cannot seem to find a way to restrict the user from entering a date less than 6 years from today's date. E.g. if incident date selected from the calender is more than 6 years ago from today then msgbox (cannot claim if occurred more than 6 years ago) and return to calendar to select a date.
Currently I have the following which works to ensure date is not on the future.
Private Sub MonthView1_DateClick(ByVal DateClicked As Date)
On Error Resume Next
'this checks the inpute date is not in the future
If frmCalendar.MonthView1.Value > Date Then
MsgBox "You have selected a future date, please try again!", vbOKOnly
frmCalendar.MonthView1.Value = Date
Else
Range("F9").Value = DateClicked
Unload frmCalendar 'can use unload me instead
End If
End Sub
Dateadd does note seem to work with the calendar. Any ideas?
Bookmarks