Time index 14:35 I am struggling with a situation when a user does not enter a valid date. I have tried using On Error Resume Next. The error gets ignored but the record does not get written into the table.
Please advice me what i can do. Thank you! MICAH
Reply from Richard Rost:
Well, first make sure there's something in the field. Then specifically convert it to a DATE value and make sure it's within a valid date range. I do something like this:
MyDateTxt = request("MyDateField") If MyDateTxt = "" then response.write "INVALID DATE" MyDate = CDATE(MyDateText) if MyDate < #1/1/2001# or MyDate > Now() then response.write "INVALID DATE"
Something along those lines.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Active Server Pages 301.