0

I am having a problem validating a date entered by user. This date must be later than todays date(at input time). I have attempted using the > (today) but this will not work if the the month is larger then input time. If you have any examples I would greatly appreciate it.
Example of what i have tried:

if userdate < FormatDateTime(Today) then
lblerrormessage.visible = True
2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by ProfessorPC
1

Try this:

Dim d As DateTime = CDate(TextBox1.Text)
        If (DateTime.Compare(Now, d) > 0) Then
            MessageBox.Show("Entered date has already happened. Please enter a future date.")
        End If
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.