title: Restricting Date Value of Parameter in SSRS
body: <p>I have two parameters: Start Date and End Date, that filter records to include only those in this range. </p>
  
  <p>Issue one: End date cannot be earlier than Start Date - I have a solution currently that just hides the data objects and displays a text box telling the user to re-enter a valid date range. Maybe there's a better solution</p>
  
  <p>(Bigger) Issue two: I need to restrict users selecting Start date to only dates after a certain date eg. 5/25/2013. I tried a function in custom code to check and change, but unfortunately Parameters in custom code are read-only. I thought of a check in custom code and refreshing the parameter to default (an appropriate value eg. 5/25/2013) but I haven't been able to do that.</p>
  
  <p>Something like this would be ideal:</p>
  
  <pre><code>Public Function DateCheck()
  If (Report.Parameters!Open.Value &lt; DateValue("5/25/2013"))
  Report.Parameters!Open.Value =  DateValue("5/25/2013") 'or refresh to default value
  End If
  End Function 
  </code></pre>
  
  <p>Also, where do I put the Code.DateCheck() call if it works?</p>
  
  <p>Looking forward to positive responses</p>