I am trying to validate report paraters which are calendar dates. I am checking the logic for end date should not be less than start date. My code snippet is as follows:
Function CheckSignificantDate(StartDate as Date, EndDate as Date) as Integer
Dim msg as String
msg = ""
If (StartDate > EndDate) Then
msg="Start Date should not be later than End Date"
If msg <> "" Then
MsgBox(msg, 16, "Report Validation")
Err.Raise(6,Report) 'Raise an overflow
First time when you run the report, it works. But if I run the report second time, it does not give error and report start processing.
Can we add validation somewhere in report that will validate the parameter for every run?