Click here to Skip to main content
15,890,409 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi bro !!!
Now i want to custom validate for some field by using Err.Raise.
I code in code tab(report property):
VB
Public Function CheckDate(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"
                                Err.Raise(22000, "VBCore.Utility",msg)
                End If

End Function

I add a parameter X with default value expression :
=Code.CheckDate(Parameters!StartDate.Value,Parameters!EndDate.Value)

But when i run report, it displays
"The defaultvalue expression for the parameter "X" contains error: Start Date should not be later than End Date"

Is it right ???
I want to display only : "Start Date should not be later than End Date".
Is it possible ???
if i dont add default value for parameter X can i run function CheckDate when run report ???
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900