View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
will will is offline
external usenet poster
 
Posts: 2
Default Validating a long date in VBA

Hi Everyone, new VBA coder here.

I just wondered if there was an easy of tackling this problem please:

I have a text box on a form which defaults to the current date in long
form i.e. ddd-dd-mm-yyyy. (Obviously this would be mm-dd in some
countries, but this doesn't matter here.)

9 times out of 10 the user won't need to change this date but they may
have to. They will be able to change the current date, for instance,
to yesterday's date rather than today's. Trouble is, they may enter a
valid date but the day of the week wouldn't change automatically,
leading to invalid data - unless they changed it manually.

Is there some way that I can validate a long date? I have come across
some date-validation routines but they only check whether a date is
valid rather than a date-day combination.

Thank you for any insight into this.

W