calendar dates

G

Guest

Hi,
I have a calendar control(11) on a form along with a text box and a submit
button.

When i select a date on the calendar it puts the date into the text box no
problem. When the submit button is clicked my code sorts whether the date
selected is earlier than the current system date or not.
If it is earlier then a label pops up saying "invalid date" and a new
acceptable date has to be entered. The submit only accepts if the selected
date is greater than or equal to the system date.
This works fine if I select a date in the same month as the system date.

However, if i select 16/04/2006 (system date 05/05/06) it accepts it when it
shouldn't but if I select 04/04/2006 if declines it like it should.

It is as if it is only reading the day digits and not the month or year.
Hope that makes some sort of sense. If anybody has any ideas on my problem,
help is appreciated.

Rhys
 
I

Ian King

It could be that if you're comparing the system date to the date in your
text box, the comparison is being made alphabetically. If this is the case,
either refer to the calendar control value directly, or use the CDate
function to force the text box value to a valid date.

I think that may solve it.

Ian King
 
G

Guest

Thanks for your reply. How do you mean alphabetically? By month like
January, February etc or by Day?

Rhys
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top