DateTime.DateFormat = "yyyy-MM-dd"
Dim cSelectedDate As String = "2016-06-22"
Dim dSelectedDate As Long = DateTime.DateParse(cSelectedDate)
ToastMessageShow(cSelectedDate,False) 'This toastmessage is displayed. Beyond this point nothing happens
If dSelectedDate < DateTime.Date(DateTime.Now) Then 'Compare with current date
ToastMessageShow("Date is lesser than the current date",False)
Return
Else
ToastMessageShow("Date is greater than Current date",False)
End If
ToastMessageShow("Date check completed",False)