954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Date verification

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
ProfessorPC
Posting Whiz in Training
270 posts since Dec 2007
Reputation Points: 31
Solved Threads: 29
 

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
waynespangler
Posting Pro in Training
461 posts since Dec 2002
Reputation Points: 84
Solved Threads: 58
 

That did it.
Thank you

ProfessorPC
Posting Whiz in Training
270 posts since Dec 2007
Reputation Points: 31
Solved Threads: 29
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You