Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Entering Dates in VB.NET 1

Status
Not open for further replies.

arigsby

Programmer
Oct 21, 2003
19
0
0
US
How do you prevent a date being entered in a textbox that has already passed?
 
dim myDate as date

if isDate(myTextbox.text) then
myDate = cDate(myTextbox.Text)
end if

if myDate < now() then
messagebox.show("ERROR! Date is old and stuff!", "date error", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation)
else
'do stuff
end if


try that. let me know if this helped.


hayt
 
Thanks a lot for the quick response! It worked!
 
i couldn't think of a good message to put in the message box. glad to help

...and stuff

hehe

hayt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top